:root {
    --primary-color: #0078d4;
    --secondary-color: #f1f3f4;
    --success-color: #34a853;
    --error-color: #ea4335;
    --warning-color: #fbbc05;
    --easy-color: #00b8a3;
    --medium-color: #ffc01e;
    --hard-color: #ff375f;
    --border-color: #e2e8f0;
    --text-color: #2c3e50;
    --text-secondary: #64748b;
    --bg-color: #f8f9fa;
    --sidebar-color: #f8f9fa;
    --hover-color: #f5f5f5;
    --accent-color: #007acc;
    --active-tab: #ffffff;
    --link-color: #007acc;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --heading-color: #1a202c;
    --tag-bg: #e5e7eb;
    --tag-text: #4b5563;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --card-bg: #1a202c;
    --border-color: #2d3748;
    --hover-color: #2d3748;
    --accent-color: #3b82f6;
    --sidebar-color: #1a202c;
    --active-tab: #1a202c;
    --tab-color: #2d3748;
    --link-color: #4ec9b0;
    --card-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    --heading-color: #f8fafc;
    --text-secondary: #94a3b8;
    --tag-bg: #2d3748;
    --tag-text: #e2e8f0;
    --secondary-color: #1e293b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Consolas', 'Courier New', monospace;
    line-height: 1.6;
    background: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
}

header {
    background: var(--sidebar-color);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    overflow-x: hidden;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.5rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

.nav-links a:hover {
    background: var(--hover-color);
}

.nav-links a.active {
    background: var(--active-tab);
    color: var(--text-color);
    font-weight: normal;
}

.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 3px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--hover-color);
    border-color: var(--accent-color);
}

main {
    padding: 20px 0;
}

.sidebar {
    width: 250px;
    padding-right: 20px;
}

.content {
    flex: 1;
}

.filter-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--secondary-color);
    border-radius: 8px;
}

.filter-section h3 {
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--text-secondary);
}

.filter-options {
    display: flex;
    flex-direction: column;
}

.filter-options label {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.filter-options input {
    margin-right: 8px;
}

.problems-list table {
    width: 100%;
    border-collapse: collapse;
}

.problems-list th, .problems-list td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.problems-list th {
    font-weight: 500;
    color: var(--text-secondary);
    background-color: var(--secondary-color);
}

.problems-list tr:hover {
    background-color: rgba(0,0,0,0.02);
}

.problems-list tr td:first-child {
    color: var(--text-secondary);
}

.problem-title {
    color: var(--primary-color);
    cursor: pointer;
}

.problem-title:hover {
    text-decoration: underline;
}

.difficulty {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.easy {
    background-color: rgba(0, 184, 163, 0.1);
    color: var(--easy-color);
}

.medium {
    background-color: rgba(255, 192, 30, 0.1);
    color: var(--medium-color);
}

.hard {
    background-color: rgba(255, 55, 95, 0.1);
    color: var(--hard-color);
}

.problem-view {
    display: flex;
    flex-direction: column;
}

.problem-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.problem-header h2 {
    margin-right: 15px;
}

.problem-description {
    margin-bottom: 30px;
    line-height: 1.8;
}

.problem-description pre {
    background-color: var(--bg-color);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 10px 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .problem-description pre {
    background-color: #1e1e1e;
    color: #d4d4d4;
    border-color: #3e3e42;
}

.problem-description p {
    margin-bottom: 15px;
}

.problem-description code {
    font-family: 'Courier New', Courier, monospace;
    background-color: var(--bg-color);
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .problem-description code {
    background-color: #1e1e1e;
    color: #d4d4d4;
    border-color: #3e3e42;
}

/* Стили редактора кода */
.code-editor {
    margin: 1.5rem 0;
    border: 1px solid #44475a;
    border-radius: 12px;
    overflow: hidden;
    background: #282a36;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#language-select {
    padding: 0.8rem 1rem;
    border: none;
    border-bottom: 1px solid #44475a;
    width: 100%;
    background-color: #282a36;
    font-family: 'Consolas', 'Courier New', monospace;
    color: #f8f8f2;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

#language-select:hover {
    background-color: #44475a;
}

#language-select:focus {
    outline: none;
    border-color: #bd93f9;
}

#language-select option {
    background-color: #282a36;
    color: #f8f8f2;
}

#editor {
    height: 400px;
    width: 100%;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
}

/* Стили для тестовых случаев */
.test-cases {
    margin-top: 1.5rem;
}

.test-case {
    padding: 1.2rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    background-color: #282a36;
    border: 1px solid #44475a;
    transition: all 0.3s ease;
}

.test-case:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.test-case h4 {
    margin-bottom: 1rem;
    color: #f8f8f2;
    font-size: 1rem;
    font-weight: 500;
}

.test-case pre {
    background-color: #1e1f29;
    padding: 1rem;
    border-radius: 8px;
    margin: 0.5rem 0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    color: #f8f8f2;
    border: 1px solid #44475a;
    overflow-x: auto;
}

.test-case.passed {
    border-left: 4px solid #50fa7b;
}

.test-case.failed {
    border-left: 4px solid #ff5555;
}

/* Стили для кнопок */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn.run-btn {
    background-color: #bd93f9;
    color: #282a36;
    margin-right: 1rem;
}

.btn.submit-btn {
    background-color: #50fa7b;
    color: #282a36;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

#back-to-list {
    margin-left: auto;
    background-color: #44475a;
    color: #f8f8f2;
    border: 1px solid #6272a4;
}

#back-to-list:hover {
    background-color: #6272a4;
    border-color: #bd93f9;
}

/* Медиа-запросы для редактора кода */
@media (max-width: 768px) {
    .code-editor {
        margin: 1rem 0;
        border-radius: 8px;
    }

    #editor {
        height: 300px;
    }

    .test-case {
        padding: 1rem;
        margin-bottom: 0.8rem;
    }

    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    #editor {
        height: 250px;
    }

    .test-case {
        padding: 0.8rem;
    }

    .test-case pre {
        padding: 0.8rem;
        font-size: 0.85rem;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 0 10px;
    }
    
    .sidebar {
        width: 100%;
        padding-right: 0;
        margin-bottom: 20px;
    }

    header {
        position: relative;
    }

    nav {
        flex-direction: column;
        gap: 1rem;
        padding: 0.5rem;
        width: 100%;
    }

    .nav-links {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        padding: 0 10px;
    }

    .nav-links a {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .logo {
        padding: 0 10px;
    }

    .problems-list {
        overflow-x: auto;
    }

    .problems-list table {
        min-width: 600px;
    }

    .problem-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    #back-to-list {
        margin-left: 0;
        width: 100%;
    }

    .social-links {
        flex-direction: column;
        align-items: center;
    }

    .social-links .social-link {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .code-editor {
        margin: 0 -10px;
        border-radius: 0;
    }

    .test-case {
        margin: 0 -10px 15px -10px;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.2rem;
    }

    nav {
        padding: 0.5rem 0;
    }

    .nav-links {
        padding: 0 5px;
    }

    .nav-links a {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    .theme-toggle {
        padding: 0.3rem 0.6rem;
    }

    .social-media {
        padding: 2rem 1rem;
    }

    .social-media h2 {
        font-size: 1.5rem;
    }

    footer {
        padding: 15px 10px;
    }

    footer p {
        font-size: 0.8rem;
    }
}

/* Social Media Block Styles */
.social-media {
    background: var(--card-bg);
    padding: 3rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 2rem 0;
}

.social-media h2 {
    color: var(--heading-color);
    font-size: 1.8rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.social-media h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto;
}

.social-links .social-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    background: var(--bg-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    min-width: 160px;
}

.social-links .social-link:hover {
    transform: translateY(-5px);
    background: var(--accent-color);
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.social-links .social-link i {
    font-size: 1.5rem;
}

.social-links .social-link span {
    font-size: 1rem;
    font-weight: 500;
}

/* Footer Styles */
footer {
    background: var(--sidebar-color);
    color: var(--text-color);
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    position: relative;
    width: 100%;
    margin-top: 2rem;
}

footer p {
    margin: 5px 0;
    font-size: 0.9rem;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--link-color);
}

/* Стили для кнопок действий задачи */
.problem-actions {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.solution-btn {
    background-color: #6272a4;
    color: #f8f8f2;
    border: 1px solid #bd93f9;
}

.solution-btn:hover {
    background-color: #bd93f9;
    border-color: #6272a4;
}

/* Стили для просмотра решения */
.solution-view {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background-color: #282a36;
    border: 1px solid #44475a;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.solution-view h3 {
    color: #f8f8f2;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.solution-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.solution-tab {
    padding: 0.5rem 1rem;
    background-color: #44475a;
    color: #f8f8f2;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.solution-tab:hover {
    background-color: #6272a4;
}

.solution-tab.active {
    background-color: #bd93f9;
    color: #282a36;
}

.solution-code {
    background-color: #1e1f29;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #44475a;
    overflow-x: auto;
}

.solution-code pre {
    margin: 0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #f8f8f2;
}

/* Медиа-запросы для решения */
@media (max-width: 768px) {
    .problem-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .solution-view {
        padding: 1rem;
        margin: 1rem 0;
    }

    .solution-tabs {
        flex-wrap: wrap;
    }

    .solution-tab {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .solution-view {
        padding: 0.8rem;
    }

    .solution-code {
        padding: 0.8rem;
    }

    .solution-code pre {
        font-size: 0.85rem;
    }
}