/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: #2c3e50;
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    gap: 20px;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-size: 20px;
    font-weight: 700;
    transition: color 0.3s ease;
}

.logo a:hover {
    color: #3498db;
}

.logo img {
    width: 49px;
    height: 45px;
}

.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 30px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: #7f8c8d;
    z-index: 2;
    transition: color 0.3s ease;
}

.search-box.focused .search-icon {
    color: #3498db;
}

.search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: none;
    border-radius: 25px;
    background-color: #34495e;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: #95a5a6;
}

.search-input:focus {
    outline: none;
    background-color: #3e5063;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: #bdc3c7;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 0;
}

.nav-link:hover,
.nav-link.active,
.nav-link.hover {
    color: #3498db;
    transform: translateY(-2px);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #3498db;
}

.btn-add {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

.btn-add:hover,
.btn-add.hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

/* Main Content */
.main {
    background-color: white;
    min-height: calc(100vh - 200px);
    padding: 30px 0 50px;
}

/* Homepage specific - no top padding */
body:has(.hero) .main {
    padding: 0 0 50px;
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 20px;
    font-size: 14px;
    color: #7f8c8d;
}

.breadcrumbs a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.separator {
    margin: 0 8px;
}

/* Page Title */
.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 25px;
}

/* About Page Content */
.about-content {
    margin-bottom: 40px;
}

.about-text {
    font-size: 16px;
    line-height: 1.7;
    color: #495057;
}

.about-text h2 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin: 30px 0 15px 0;
}

.about-text h2:first-of-type {
    margin-top: 25px;
}

.about-text p {
    margin-bottom: 20px;
}

.about-text ul {
    margin: 15px 0 20px 20px;
    padding-left: 0;
}

.about-text li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.about-text strong {
    color: #2c3e50;
    font-weight: 600;
}

/* Contacts Page Content */
.contacts-content {
    margin-bottom: 40px;
}

.contacts-text {
    font-size: 16px;
    line-height: 1.7;
    color: #495057;
}

.contacts-text h2 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin: 30px 0 15px 0;
}

.contacts-text h2:first-of-type {
    margin-top: 25px;
}

.contacts-text p {
    margin-bottom: 20px;
}

.contacts-text ul {
    margin: 15px 0 20px 20px;
    padding-left: 0;
}

.contacts-text li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.contacts-text strong {
    color: #2c3e50;
    font-weight: 600;
}

/* Contact Form */
.contact-form-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
}

.contact-form-section h2 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 25px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-select {
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
    background-color: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.btn-submit:hover {
    background: #218838;
    transform: translateY(-1px);
}

.help-block {
    display: block;
    font-size: 14px;
    color: darkred;
    margin-top: 5px;
    font-style: italic;
}

.add-channel-description {
    margin-bottom: 40px;
    padding: 20px;
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    text-align: center;
}

.add-channel-description p {
    font-size: 18px;
    color: #2c3e50;
    margin: 0;
    font-weight: 500;
}

.add-channel-description.error p {
    color: darkred;
}

.add-channel-description.success p {
    color: darkgreen;
}

/* Error Pages */
.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px 0;
}

.error-content {
    text-align: center;
    max-width: 600px;
}

.error-icon {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.error-title {
    font-size: 72px;
    font-weight: 700;
    color: #e74c3c;
    margin-bottom: 10px;
    line-height: 1;
}

.error-subtitle {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 25px;
}

.error-description {
    font-size: 16px;
    line-height: 1.6;
    color: #5a6c7d;
    margin-bottom: 30px;
}

.error-description p {
    margin-bottom: 15px;
}

.error-description ul {
    text-align: left;
    margin: 15px 0;
    padding-left: 20px;
}

.error-description li {
    margin-bottom: 8px;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    text-decoration: none;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    text-decoration: none;
    color: white;
}

.error-suggestions {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.error-suggestions h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
}

.error-suggestions ul {
    text-align: left;
    margin: 0;
    padding-left: 20px;
}

.error-suggestions li {
    margin-bottom: 8px;
}

.error-suggestions a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.error-suggestions a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.maintenance-info {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.maintenance-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.maintenance-info p {
    margin: 0;
    font-size: 14px;
    color: #495057;
}

.maintenance-info a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.maintenance-info a:hover {
    text-decoration: underline;
}

/* Social Share */
.social-share {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
}

.social-share span {
    font-weight: 500;
    color: #5a6c7d;
}

.social-buttons {
    display: flex;
    gap: 10px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    color: white;
}

.social-btn.vk { background-color: #4c75a3; }
.social-btn.ok { background-color: #ee8208; }
.social-btn.telegram { background-color: #0088cc; }
.social-btn.twitter { background-color: #1da1f2; }
.social-btn.viber { background-color: #59267c; }
.social-btn.whatsapp { background-color: #25d366; }

.social-btn:hover,
.social-btn.hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Filters */
.filters-section {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.filters {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.filter-input,
.filter-select {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: white;
}

.filter-input:focus,
.filter-select:focus,
.filter-input.focused,
.filter-select.focused {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Audience Range */
.audience-range .range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-input {
    flex: 1;
    min-width: 0;
}

.range-separator {
    color: #6c757d;
    font-weight: 500;
    flex-shrink: 0;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-group.horizontal {
    flex-direction: row;
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
    font-size: 14px;
    color: #495057;
    transition: color 0.3s ease;
}

.checkbox-label:hover {
    color: #2c3e50;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3498db;
    cursor: pointer;
}

.checkbox-text {
    user-select: none;
}

/* Search Button */
.filter-button-group {
    justify-self: end;
    align-self: end;
}

.btn-search {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    width: 196px;
}

.btn-search:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* Results */
.results-section {
    margin-bottom: 50px;
}

.results-header {
    margin-bottom: 25px;
}

.results-header h2 {
    font-size: 20px;
    color: #495057;
    font-weight: 500;
}

/* Channel Grid */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.channel-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    opacity: 1;
    transform: translateY(0);
    display: block;
    text-decoration: none;
    color: inherit;
}

.channel-card:hover,
.channel-card.hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.channel-card.blurred .channel-header,
.channel-card.blurred .channel-description {
    filter: blur(3px);
}

.adult-content-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    filter: none;
}

.adult-content-btn:hover {
    background: #c0392b;
    transform: translate(-50%, -50%) scale(1.05);
}

.channel-header {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.channel-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f1f3f4;
    flex-shrink: 0;
}

.channel-info {
    flex: 1;
}

.channel-name {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    line-height: 1.3;
}

.channel-username {
    color: #3498db;
    font-size: 14px;
    margin-bottom: 8px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.channel-username:hover {
    color: #2980b9;
    text-decoration: underline;
}

.channel-subscribers {
    color: #7f8c8d;
    font-size: 14px;
    font-weight: 500;
}

.channel-description {
    color: #5a6c7d;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 10px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

.page-btn:hover:not(.disabled) {
    background: #f8f9fa;
    border-color: #adb5bd;
    transform: translateY(-1px);
    text-decoration: none;
    color: #495057;
}

.page-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.page-numbers {
    display: flex;
    gap: 4px;
    align-items: center;
}

.page-dots {
    padding: 8px 4px;
    color: #6c757d;
}

/* Other Categories */
.other-categories {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e9ecef;
}

.other-categories h2 {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.category-link {
    display: inline-block;
    padding: 8px 16px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.category-link:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-2px);
    text-decoration: none;
}

/* Footer */
.footer {
    background-color: #2c3e50;
    color: #bdc3c7;
    padding: 40px 0;
}

.footer-content {
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: #3498db;
    transform: translateY(-1px);
}

.footer-text {
    max-width: 800px;
    margin: 0 auto 25px;
    line-height: 1.6;
    font-size: 14px;
}

.footer-copyright {
    font-size: 14px;
    color: #95a5a6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .search-container {
        order: 3;
        margin: 0;
        max-width: none;
        width: 100%;
    }

    .nav {
        order: 2;
        gap: 20px;
    }

    .btn-add {
        order: 1;
        align-self: center;
    }

    .filters {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .filter-button-group {
        justify-self: stretch;
    }

    .btn-search {
        width: 100%;
    }

    .range-input {
        max-width: 130px;
    }

    .channel-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        flex-direction: column;
        gap: 15px;
    }

    .page-title {
        font-size: 24px;
    }

    .social-share {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .categories-list {
        justify-content: flex-start;
    }

    /* Homepage specific mobile padding */
    body:has(.hero) .main {
        padding: 0 0 30px;
    }

    .channel-card {
        padding: 15px;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .about-text h2,
    .contacts-text h2 {
        font-size: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .error-title {
        font-size: 48px;
    }

    .error-subtitle {
        font-size: 22px;
    }

    .error-actions {
        flex-direction: column;
        align-items: center;
    }

    .error-icon svg {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .main {
        padding: 20px 0 30px;
    }

    .channel-card {
        padding: 15px;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .about-text,
    .contacts-text {
        font-size: 15px;
    }

    .about-text h2,
    .contacts-text h2 {
        font-size: 18px;
    }

    .contact-form-section {
        padding: 20px;
    }

    .error-title {
        font-size: 36px;
    }

    .error-subtitle {
        font-size: 18px;
    }

    .error-icon svg {
        width: 60px;
        height: 60px;
    }

    .error-page {
        padding: 20px 0;
        min-height: 50vh;
    }

    .range-input {
        max-width: 130px;
    }
}

@media (max-width: 1023px) and (min-width: 769px) {
    .filters {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
    }

    .filter-button-group {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .btn-search {
        width: 100%;
    }
}