/* ================================================
   RESPONSIVE.CSS — Ідеальна адаптивність сайту
   Застосовує fluid типографіку + сітку для всіх
   розмірів екрану
   ================================================ */

/* ===== FLUID TYPOGRAPHY via clamp() ===== */
/* Автоматично масштабується від мобільного до десктопу */

html {
    /* Базовий розмір шрифту: 14px (мобільний) -> 16px (десктоп) */
    font-size: clamp(14px, 1.1vw + 11px, 16px);
}

/* Hero заголовок: 32px (мобільний) -> 72px (десктоп) */
.hero h1 {
    font-size: clamp(32px, 5vw + 12px, 72px) !important;
    font-weight: 800 !important;
    letter-spacing: clamp(-1px, -0.1vw, -2px);
    line-height: 1.3;
    padding-bottom: 5px;
}

/* Hero параграф */
.hero p {
    font-size: clamp(15px, 1.2vw + 10px, 20px) !important;
}

/* Заголовки секцій */
.section-title {
    font-size: clamp(24px, 3vw + 10px, 42px) !important;
}

.page-title {
    font-size: clamp(28px, 4vw + 10px, 48px) !important;
}

/* ===== ЗАГАЛЬНА СІТКА ===== */

/* Забезпечуємо що нічого не виходить за межі екрану */
* {
    max-width: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== NAVBAR ===== */

/* Відображення для ДУЖЕ МАЛЕНЬКИХ телефонів (< 400px) */
@media (max-width: 400px) {
    .navbar {
        width: calc(100% - 24px) !important;
        padding: 10px 12px !important;
    }

    .navbar-logo {
        height: 36px !important;
    }

    .theme-toggle {
        width: 38px !important;
        height: 38px !important;
    }
}

/* Середній мобільний (400-768px) */
@media (max-width: 768px) {
    .navbar {
        top: 12px;
        width: calc(100% - 32px);
    }

    .content {
        padding-top: 90px;
    }

    @media (max-width: 400px) {
        .site-version-toggle {
            width: 38px !important;
            height: 38px !important;
        }
    }

    /* ===== HERO SECTION ===== */
    @media (max-width: 480px) {
        .hero {
            padding: 40px 10px 30px;
        }
    }

    @media (max-width: 768px) {
        .hero {
            padding: 50px 15px 40px;
        }
    }

    /* ===== ABOUT SECTION ===== */
    @media (max-width: 768px) {
        .about-container {
            flex-direction: column;
            gap: 20px;
        }

        .about-card {
            padding: 28px 22px !important;
        }

        .about-card h2 {
            font-size: clamp(20px, 4vw + 8px, 32px) !important;
        }

        .about-card p {
            font-size: clamp(14px, 2vw + 10px, 18px) !important;
        }

        .about-image-card {
            height: 220px !important;
            min-height: 180px;
        }
    }

    @media (max-width: 480px) {
        .about-card {
            padding: 22px 18px !important;
        }

        .about-image-card {
            height: 200px !important;
        }
    }

    /* ===== SERVER INFO CARDS ===== */
    @media (max-width: 768px) {
        .server-info {
            grid-template-columns: 1fr !important;
            gap: 16px;
            margin: 30px 0 !important;
        }

        .info-card {
            padding: 24px 20px !important;
        }

        .info-header h3 {
            font-size: clamp(18px, 3vw + 10px, 24px);
        }

        code {
            font-size: clamp(12px, 2.5vw + 6px, 15px) !important;
            padding: 10px 12px !important;
            word-break: break-all;
        }
    }

    @media (max-width: 480px) {
        .info-card {
            padding: 20px 16px !important;
        }

        .info-icon {
            font-size: 24px !important;
        }
    }

    /* ===== TEAM PAGE ===== */
    @media (max-width: 1200px) {
        .team-container {
            grid-template-columns: repeat(2, 1fr) !important;
            gap: 20px;
        }
    }

    @media (max-width: 768px) {
        .team-container {
            grid-template-columns: 1fr !important;
            gap: 16px;
        }

        .team-section {
            padding: 60px 0 !important;
        }

        .team-category {
            padding: 35px 20px 20px !important;
        }

        .member-info h4 {
            font-size: 15px !important;
        }
    }

    @media (max-width: 480px) {
        .team-category {
            padding: 35px 16px 16px !important;
        }

        .member-avatar {
            width: 44px !important;
            height: 44px !important;
        }
    }

    /* ===== INFO PAGE ===== */

    /* Status Card */
    @media (max-width: 768px) {
        .status-card {
            padding: 24px 20px !important;
        }

        .status-details {
            flex-wrap: wrap;
            gap: 12px !important;
            justify-content: center;
        }

        .stat-item {
            min-width: calc(50% - 8px) !important;
            flex: 1 1 calc(50% - 8px);
            padding: 12px 14px !important;
        }

        .stat-item:has(.copy-ip) {
            min-width: 100% !important;
            flex: 1 1 100%;
        }

        .stat-value {
            font-size: 18px !important;
        }

        .stat-value.copy-ip {
            font-size: 13px !important;
            word-break: break-all;
        }

        .status-content h2 {
            font-size: clamp(18px, 4vw + 8px, 26px) !important;
            flex-wrap: wrap;
            text-align: center;
        }
    }

    @media (max-width: 480px) {
        .stat-item {
            min-width: 100% !important;
            flex: 1 1 100%;
        }
    }

    /* Map & Social */
    @media (max-width: 992px) {
        .map-social-wrapper {
            grid-template-columns: 1fr !important;
        }
    }

    @media (max-width: 768px) {
        .map-container {
            height: 300px !important;
        }

        .social-sidebar-list {
            grid-template-columns: repeat(2, 1fr) !important;
        }
    }

    @media (max-width: 480px) {
        .social-sidebar-list {
            grid-template-columns: 1fr !important;
        }

        .map-container {
            height: 250px !important;
        }
    }

    /* Roadmap */
    @media (max-width: 768px) {
        .roadmap-grid {
            grid-template-columns: 1fr !important;
            gap: 12px;
        }
    }

    /* ===== MEMBER MODAL (Team page) ===== */
    @media (max-width: 768px) {
        .modal-content {
            width: 96% !important;
            border-radius: 24px !important;
            max-height: 90vh;
            overflow-y: auto;
        }

        .modal-layout {
            flex-direction: column !important;
        }

        .modal-skin-container {
            flex: 0 0 240px !important;
            border-right: none !important;
            border-bottom: 1px solid var(--border-color);
        }

        .modal-info-container {
            padding: 24px 20px !important;
        }

        .modal-title h3 {
            font-size: clamp(22px, 5vw + 10px, 42px) !important;
        }

        .modal-bio {
            font-size: 14px !important;
            padding: 16px !important;
        }
    }

    @media (max-width: 480px) {
        .modal-skin-container {
            flex: 0 0 200px !important;
        }

        .modal-info-container {
            padding: 18px 16px !important;
        }
    }

    /* ===== FOOTER ===== */
    @media (max-width: 900px) {
        .footer-inner {
            flex-direction: column;
            align-items: center;
            padding: 16px 20px;
            gap: 14px;
        }

        .footer-divider-v {
            display: none;
        }

        .footer-nav {
            grid-template-columns: repeat(2, auto) !important;
            grid-template-rows: repeat(4, auto) !important;
            gap: 8px clamp(20px, 4vw, 40px) !important;
            width: 100%;
            justify-content: center !important;
        }
    }

    @media (max-width: 768px) {
        .footer-title-img {
            height: 44px !important;
        }

        .footer-nav-link {
            font-size: 13px !important;
            padding: 5px 0 !important;
            margin-right: 0 !important;
        }
    }

    @media (max-width: 480px) {
        .footer-inner {
            padding: 14px 16px;
        }

        .footer-nav {
            grid-template-columns: repeat(2, 1fr) !important;
            gap: 2px 16px !important;
        }
    }

    /* ===== LOGIN & ERROR MODALS ===== */
    @media (max-width: 480px) {
        .login-modal {
            padding: 24px 16px !important;
            width: 96% !important;
            border-radius: 18px !important;
        }

        .login-header h2 {
            font-size: 22px !important;
        }

        .login-header-icon {
            font-size: 36px !important;
        }
    }

    /* ===== PROMO MODAL ===== */
    @media (max-width: 480px) {
        .promo-modal {
            padding: 28px 20px !important;
            border-radius: 18px !important;
        }

        .promo-code {
            font-size: 18px !important;
            letter-spacing: 1px;
        }

        .promo-header h3 {
            font-size: 20px !important;
        }
    }

    /* ===== CABINET PAGE ===== */
    @media (max-width: 1024px) {
        .cabinet-main-grid {
            grid-template-columns: 1fr !important;
        }
    }

    @media (max-width: 768px) {
        .cabinet-content {
            padding-top: 90px !important;
            padding-left: 16px !important;
            padding-right: 16px !important;
        }

        .cabinet-header {
            flex-direction: column;
            text-align: center;
            padding: 24px 20px !important;
            gap: 20px;
        }

        .cabinet-avatar {
            width: 90px !important;
            height: 90px !important;
            align-self: center;
        }

        .cabinet-user-info h1 {
            font-size: clamp(22px, 4vw + 10px, 36px) !important;
        }

        .cabinet-tag-container {
            max-width: 100% !important;
            margin: 0 auto;
        }

        .cabinet-card {
            padding: 20px 16px !important;
        }

        .cabinet-skin-viewer {
            height: 300px !important;
        }

        .cabinet-stats-grid {
            grid-template-columns: repeat(2, 1fr) !important;
        }
    }

    @media (max-width: 480px) {
        .cabinet-stats-grid {
            grid-template-columns: 1fr !important;
        }

        .cabinet-skin-viewer {
            height: 260px !important;
        }
    }

    /* ===== SERVER DETAIL MODAL ===== */
    @media (max-width: 768px) {
        .server-modal-content {
            width: 96% !important;
            height: 92vh !important;
        }

        .server-modal-grid {
            flex-direction: column !important;
            overflow: visible;
        }

        .player-column {
            max-width: 100% !important;
            border-right: none !important;
            border-bottom: 1px solid var(--border-color);
            max-height: 200px;
        }

        .server-modal-header {
            padding: 16px 20px !important;
        }

        .server-modal-header h3 {
            font-size: 18px !important;
        }
    }

    /* ===== FEEDBACK MODAL ===== */
    @media (max-width: 768px) {
        .fb-modal {
            width: 96% !important;
            border-radius: 20px !important;
            max-height: 90vh;
            overflow-y: auto;
        }

        .fb-dialog-header {
            padding: 16px 20px !important;
        }

        .fb-modal-body {
            padding: 16px 20px !important;
        }
    }

    /* ===== NOTIFICATIONS ===== */
    @media (max-width: 480px) {

        .error-notification,
        .cabinet-notification {
            right: 8px !important;
            left: 8px !important;
            top: 80px !important;
            min-width: auto !important;
            max-width: none !important;
        }
    }

    /* ===== SCROLLBAR в модальних вікнах ===== */
    .modal-content,
    .server-modal-content,
    .fb-modal,
    .player-list-scroll,
    .chat-display,
    .adm-feed-panel {
        scrollbar-width: thin;
        scrollbar-color: var(--accent-color) transparent;
    }

    .modal-content::-webkit-scrollbar,
    .server-modal-content::-webkit-scrollbar,
    .fb-modal::-webkit-scrollbar,
    .player-list-scroll::-webkit-scrollbar,
    .chat-display::-webkit-scrollbar,
    .adm-feed-panel::-webkit-scrollbar {
        display: block;
        width: 4px;
    }

    .modal-content::-webkit-scrollbar-thumb,
    .server-modal-content::-webkit-scrollbar-thumb,
    .fb-modal::-webkit-scrollbar-thumb,
    .player-list-scroll::-webkit-scrollbar-thumb,
    .chat-display::-webkit-scrollbar-thumb,
    .adm-feed-panel::-webkit-scrollbar-thumb {
        background: var(--accent-color);
        border-radius: 10px;
        opacity: 0.5;
    }

    /* ===== ВЕЛИКІ ЕКРАНИ (1400px+) ===== */
    @media (min-width: 1400px) {
        .content {
            max-width: 1300px !important;
        }

        .footer-inner {
            max-width: 1280px !important;
        }

        .navbar,
        .cabinet-main-wrapper {
            max-width: 1260px !important;
        }
    }

    /* ===== EXTRA LARGE (1800px+) ===== */
    @media (min-width: 1800px) {
        .content {
            max-width: 1500px !important;
        }

        .navbar,
        .cabinet-main-wrapper {
            max-width: 1440px !important;
        }

        .footer-inner {
            max-width: 1440px !important;
        }

        .hero h1 {
            font-size: 80px !important;
        }
    }

    /* ===== TOUCH DEVICES ===== */
    @media (hover: none) and (pointer: coarse) {

        /* Збільшені зони натискання для сенсорних екранів */
        .nav-links a,
        .cabinet-btn,
        .footer-nav-link {
            min-height: 44px;
            display: flex;
            align-items: center;
        }

        .theme-toggle,
        .hamburger-menu {
            min-width: 44px;
            min-height: 44px;
        }

        .team-card {
            padding: 16px 18px !important;
        }

        .social-tile {
            min-height: 64px;
        }

        /* Прибираємо hover-ефекти, які не потрібні на тач-пристроях */
        .about-image-card:hover .about-img {
            transform: none !important;
        }

        .team-category:hover {
            transform: none !important;
        }
    }

    /* ===== LANDSCAPE MOBILE ===== */
    @media (max-height: 500px) and (orientation: landscape) {
        .content {
            padding-top: 80px !important;
        }

        .hero {
            padding: 30px 15px 20px !important;
        }

        .hero h1 {
            font-size: 32px !important;
        }

        .navbar {
            top: 8px !important;
        }
    }

    /* ===== PRINT STYLES ===== */
    @media print {

        .navbar,
        .theme-toggle,
        .hamburger-menu,
        .floating-element,
        .footer {
            display: none !important;
        }

        .content {
            padding-top: 20px !important;
            max-width: 100% !important;
        }
    }
}