/* ============================================================
   EnteRoot — Kapsamlı Responsive CSS (Tüm Sayfalar)
   Breakpoints:
     <=1100px : Tablet landscape
     <=900px  : Sidebar collapse + tablet portrait
     <=768px  : Tablet küçük
     <=600px  : Büyük telefon (landscape)
     <=480px  : Telefon portrait
     <=360px  : Küçük telefon
   ============================================================ */


/* ============================================================
   1. GENEL LAYOUT (site-layout, site-main, container)
   ============================================================ */

@media (max-width: 1100px) {
    .site-content {
        padding: 28px 20px;
        max-width: 100%;
    }
}

@media (max-width: 900px) {
    .site-sidebar {
        transform: translateX(-100%);
        z-index: 200;
    }
    .site-sidebar.open,
    .site-sidebar.sidebar-open {
        transform: translateX(0);
        box-shadow: 8px 0 30px rgba(0,0,0,0.5);
    }
    .sidebar-toggle {
        display: flex !important;
    }
    .sidebar-overlay.active {
        display: block !important;
    }
    .site-main {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .site-content {
        padding: 20px 16px;
        padding-top: 70px;
    }
    .container {
        padding: 20px 16px;
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .site-sidebar {
        width: 85vw;
        max-width: 300px;
    }
    .site-content {
        padding: 16px 12px;
        padding-top: 65px;
    }
}

@media (max-width: 480px) {
    .site-sidebar {
        width: 100vw;
        max-width: none;
    }
    .site-content {
        padding: 14px 10px;
        padding-top: 62px;
    }
    .container {
        padding: 14px 10px;
    }
}


/* ============================================================
   2. LANDING PAGE (index.html)
   ============================================================ */

@media (max-width: 768px) {
    .landing-header {
        padding: 14px 0;
    }
    .landing-header__nav {
        gap: 12px;
    }
    .landing-header__nav-link {
        display: none;
    }
    .hero {
        padding: 60px 0 40px;
    }
    .hero__title {
        font-size: 2.4rem;
    }
    .hero__subtitle {
        font-size: 1rem;
    }
    .hero__actions {
        flex-direction: column;
        align-items: center;
    }
    .hero__actions .btn {
        width: 100%;
        max-width: 320px;
    }
    .hero__stats {
        flex-direction: column;
        gap: 12px;
        padding: 20px;
    }
    .hero__stat-divider {
        width: 40px;
        height: 1px;
    }
    .features__grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin: 0 auto;
    }
    .features__heading {
        font-size: 1.8rem;
    }
    .cta-box {
        padding: 40px 24px;
    }
    .cta-box__title {
        font-size: 1.4rem;
    }
    .upload-ctf-box {
        padding: 36px 20px;
    }
    .community-box {
        flex-direction: column;
        padding: 28px 20px;
        gap: 20px;
    }
    .community-quote__text {
        font-size: 1.1rem;
    }
    .community-highlights {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .hero__title {
        font-size: 1.9rem;
    }
    .hero__subtitle {
        font-size: 0.9rem;
    }
    .landing-header__logo-text {
        font-size: 1.15rem;
    }
    .hero__badge {
        font-size: 0.75rem;
        padding: 5px 12px;
    }
    .feature-card {
        padding: 24px 18px 18px;
    }
    .hero__stat-number {
        font-size: 1.6rem;
    }
}

@media (max-width: 360px) {
    .hero__title {
        font-size: 1.65rem;
    }
}


/* ============================================================
   3. LANDING V2 (Sinematik Hero + Globe)
   ============================================================ */

@media (max-width: 1024px) {
    .features-v2__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero-cinematic__title {
        font-size: 3.5rem;
    }
    .globe-wrapper {
        width: 340px;
        height: 340px;
    }
}

@media (max-width: 768px) {
    .hero-cinematic {
        padding: 50px 0 30px;
        min-height: 80vh;
    }
    .hero-cinematic__title {
        font-size: 2.4rem;
    }
    .hero-cinematic__quote {
        font-size: 1rem;
    }
    .hero-cinematic__subtitle {
        font-size: 0.95rem;
    }
    .hero-cinematic__actions {
        flex-direction: column;
        align-items: center;
    }
    .hero-cinematic__actions .btn {
        width: 100%;
        max-width: 320px;
    }
    .features-v2__grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin: 0 auto;
    }
    .globe-wrapper {
        width: 260px;
        height: 260px;
    }
    .globe-section__heading {
        font-size: 2rem;
    }
    .globe-stats {
        flex-direction: column;
        align-items: center;
    }
    .globe-stat-pill {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    .journey-timeline {
        flex-direction: column;
        gap: 20px;
    }
    .journey-connector {
        width: auto;
        height: 30px;
    }
    .journey-connector__line {
        width: 2px;
        height: 100%;
    }
    .journey-step {
        flex: none;
        width: 100%;
        max-width: 380px;
    }
    .creator-box__content {
        padding: 40px 24px;
    }
    .final-cta__box {
        padding: 48px 24px;
    }
    .final-cta__box h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .hero-cinematic__title {
        font-size: 2rem;
    }
    .globe-wrapper {
        width: 220px;
        height: 220px;
    }
    .features-v2__heading {
        font-size: 1.8rem;
    }
    .journey-section__heading {
        font-size: 1.8rem;
    }
    .globe-section__heading {
        font-size: 1.7rem;
    }
    .feature-card-v2 {
        padding: 28px 18px 22px;
    }
}


/* ============================================================
   4. MAIN DASHBOARD (main.php — Challenges, Leaderboard)
   ============================================================ */

@media (max-width: 768px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .challenges-grid,
    .labs-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .filter-bar {
        gap: 8px;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .filter-btn {
        padding: 6px 14px;
        font-size: 0.8rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .leaderboard-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .leaderboard-table table {
        min-width: 500px;
    }
    .section-title {
        font-size: 1.3rem;
    }
    .catalog-toolbar {
        flex-direction: column;
        gap: 8px;
    }
    .search-box {
        min-width: 100%;
    }
    .catalog-filters {
        width: 100%;
    }
    .catalog-filters select {
        flex: 1;
    }
    .modal-interaction-bar {
        flex-wrap: wrap;
        gap: 6px;
    }
}

@media (max-width: 600px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .stat-item {
        padding: 14px 10px;
    }
    .stat-value {
        font-size: 1.3rem;
    }
    .challenge-card {
        padding: 16px;
    }
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    .leaderboard-table table {
        min-width: 420px;
    }
}

@media (max-width: 480px) {
    .challenge-card {
        padding: 14px;
    }
    .challenge-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .challenge-header h3 {
        font-size: 1rem;
    }
    .challenge-points {
        font-size: 0.8rem;
        padding: 3px 10px;
    }
    .challenge-footer {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    .challenge-footer-left {
        gap: 8px;
    }
    .filter-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    .section-title {
        font-size: 1.15rem;
    }
    .flag-input {
        max-width: 100%;
        width: 100%;
    }
    #submitArea {
        flex-direction: column;
        align-items: stretch;
    }
    .interaction-area {
        flex-direction: column;
    }
    .interaction-area .btn {
        width: 100%;
    }
    .modal-footer-actions {
        flex-direction: column;
        gap: 8px;
    }
    .modal-footer-actions .btn {
        width: 100%;
        text-align: center;
    }
    .leaderboard-table table {
        min-width: 380px;
    }
    .timer-display {
        font-size: 1.6rem;
        padding: 10px;
        letter-spacing: 1px;
    }
    .modal-content {
        width: 96%;
        padding: 18px 14px;
        max-height: 92vh;
        margin: 4vh auto;
    }
    .modal-title {
        font-size: 1.15rem;
    }
}


/* ============================================================
   5. PROFIL (main.php dashboard profile section + profile.php)
   ============================================================ */

@media (max-width: 900px) {
    .profile-header-card {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .profile-quick-stats {
        justify-content: center;
    }
    .xp-bar-container {
        margin: 0 auto;
    }
    .radar-charts-grid {
        grid-template-columns: 1fr;
    }
    .gauges-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .profile-header-card {
        padding: 18px;
        gap: 14px;
    }
    .avatar-terminal {
        width: 68px;
        height: 68px;
    }
    .avatar-icon {
        font-size: 1.9rem;
    }
    .profile-username {
        font-size: 1.25rem;
    }
    .profile-quick-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    .quick-stat {
        padding: 10px 12px;
        min-width: 80px;
    }
    .quick-stat-value {
        font-size: 1.2rem;
    }
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .gauge-card {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .achievements-grid,
    .mastery-badges {
        grid-template-columns: 1fr;
    }
    .badge-selector-preview {
        gap: 10px;
    }
}

/* profile.php (public profil) */
@media (max-width: 768px) {
    .profile-layout {
        padding: 0 10px 30px;
    }
    .profile-cover {
        height: 140px;
    }
    .profile-avatar-ring {
        width: 72px;
        height: 72px;
    }
    .profile-avatar__letter {
        width: 66px;
        height: 66px;
        font-size: 1.6rem;
    }
    .profile-stats {
        gap: 14px;
        flex-wrap: wrap;
    }
    .profile-name {
        font-size: 1.2rem;
    }
    .profile-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .profile-tab {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 0.8rem;
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .profile-cover {
        height: 110px;
    }
    .profile-stats {
        gap: 8px;
    }
    .profile-stat__value {
        font-size: 1rem;
    }
    .profile-stat__label {
        font-size: 0.65rem;
    }
    .profile-actions {
        flex-direction: column;
    }
    .profile-btn {
        justify-content: center;
        width: 100%;
    }
}


/* ============================================================
   6. FEED (feed.php) + RECON (recon.php)
   ============================================================ */

@media (max-width: 768px) {
    .feed-layout {
        padding: 0 8px;
        gap: 12px;
    }
    .compose-box {
        padding: 12px;
    }
    .compose-box__avatar {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }
    .post-card {
        padding: 14px;
    }
    .post-actions {
        flex-wrap: wrap;
        gap: 4px;
    }
    .post-action-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    .compose-tool__label {
        display: none;
    }
    .compose-tool.compose-tool--labeled {
        width: 34px;
        padding: 6px;
        border-radius: 50%;
    }
    .recon-layout {
        flex-direction: column;
        gap: 12px;
    }
    .recon-sidebar {
        width: 100%;
    }
    .recon-filter-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }
    .recon-filter-item {
        flex: 1;
        text-align: center;
        justify-content: center;
        min-width: 75px;
        padding: 8px 10px;
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    .compose-box__toolbar {
        flex-wrap: wrap;
        gap: 6px;
    }
    .compose-tool {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    .compose-submit {
        padding: 5px 14px;
        font-size: 0.8rem;
    }
    .post-action-btn {
        padding: 5px 8px;
        font-size: 0.76rem;
    }
    .post-detail-overlay .post-detail-modal {
        width: 98%;
        max-height: 92vh;
    }
}


/* ============================================================
   7. EGITIMLER (trainings.php + training_view.php)
   ============================================================ */

@media (max-width: 768px) {
    .trainings-grid {
        grid-template-columns: 1fr;
    }
    .training-card {
        padding: 16px;
    }
    .training-header {
        flex-direction: column;
        gap: 8px;
    }
    .training-title {
        font-size: 1rem;
    }
    .training-footer {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    .category-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .category-tab {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 0.82rem;
    }
}

@media (max-width: 600px) {
    .training-card {
        padding: 14px;
    }
    .training-title {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .category-tab {
        padding: 6px 12px;
        font-size: 0.78rem;
    }
}


/* ============================================================
   8. LABS (labs.php + lab_view.php)
   ============================================================ */

@media (max-width: 768px) {
    .labs-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .lab-card {
        padding: 16px;
    }
    .lab-header {
        flex-direction: column;
        gap: 8px;
    }
    .lab-title {
        font-size: 1rem;
    }
    .lab-footer {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .lab-card {
        padding: 14px;
    }
    .lab-title {
        font-size: 0.95rem;
    }
}


/* ============================================================
   9. MESSAGES (messages.php)
   ============================================================ */

@media (max-width: 768px) {
    .messages-layout {
        height: calc(100vh - 90px);
        border-radius: 0;
        border: none;
        position: relative;
    }
    .msg-sidebar {
        width: 100%;
        position: absolute;
        inset: 0;
        z-index: 5;
        transition: transform 0.3s ease;
    }
    .msg-sidebar.hidden-mobile {
        transform: translateX(-100%);
    }
    .msg-chat-header__back {
        display: flex !important;
    }
    .chat-widget-window {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 80px;
        height: 60vh;
        max-height: 500px;
    }
    .chat-widget-toggle {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }
    .msg-chat-messages {
        padding: 14px;
    }
    .msg-chat-input {
        padding: 12px 14px;
    }
}

@media (max-width: 480px) {
    .chat-widget-window {
        width: 100vw;
        right: 0;
        bottom: 68px;
        border-radius: 16px 16px 0 0;
        height: 65vh;
    }
    .msg-bubble {
        max-width: 88%;
        font-size: 0.86rem;
        padding: 9px 14px;
    }
    .msg-chat-header {
        padding: 12px 14px;
    }
    .msg-chat-header__name {
        font-size: 0.9rem;
    }
}


/* ============================================================
   10. TOOLKIT (toolkit.php)
   ============================================================ */

@media (max-width: 900px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

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

@media (max-width: 480px) {
    .tool-card {
        padding: 14px;
    }
}


/* ============================================================
   11. SUPPORT + TICKET (support.php + support_view.php)
   ============================================================ */

@media (max-width: 900px) {
    .container > div[style*="grid-template-columns: 1fr 1.5fr"],
    .container > div[style*="grid-template-columns:1fr 1.5fr"],
    .container > div[style*="grid-template-columns: 1fr 2fr"],
    .container > div[style*="grid-template-columns:1fr 2fr"] {
        grid-template-columns: 1fr !important;
    }
    .container > div[style*="grid-template-columns: 350px 1fr"],
    .container > div[style*="grid-template-columns:350px 1fr"],
    .container > div[style*="grid-template-columns: 300px 1fr"],
    .container > div[style*="grid-template-columns:300px 1fr"] {
        grid-template-columns: 1fr !important;
    }
    .container > div > div[style*="height: 75vh"],
    .container > div > div[style*="height: 70vh"] {
        height: 55vh !important;
    }
    .container > div[style*="display: flex"][style*="justify-content: space-between"] {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .container > div > div[style*="height: 75vh"],
    .container > div > div[style*="height: 70vh"] {
        height: 48vh !important;
    }
    .container[style*="max-width: 900px"],
    .container[style*="max-width: 1100px"] {
        padding: 12px !important;
        margin: 8px auto !important;
    }
    .section-title {
        word-break: break-word;
    }
}


/* ============================================================
   12. NOTIFICATIONS (notifications_view.php)
   ============================================================ */

@media (max-width: 768px) {
    .notif-card {
        padding: 14px;
    }
    .notif-card > div > div > div[style*="display: flex"][style*="gap: 10px"] {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .notif-card {
        padding: 12px 10px;
        font-size: 0.88rem;
    }
}


/* ============================================================
   13. CREATOR JOURNEY (creator_journey.php)
   ============================================================ */

@media (max-width: 768px) {
    .how-step-connector {
        display: none !important;
    }
    .how-it-works__steps {
        flex-direction: column;
        gap: 16px;
    }
    .how-step {
        flex: none;
        width: 100%;
        max-width: 380px;
    }
}


/* ============================================================
   14. ADMIN PANEL (panel/)
   ============================================================ */

@media (max-width: 900px) {
    .admin-layout {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .admin-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
        padding: 12px;
    }
    .admin-nav-item {
        padding: 8px 12px;
        font-size: 0.82rem;
    }
    .admin-main {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .admin-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .admin-table {
        min-width: 600px;
    }
    .admin-card {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
    .admin-actions {
        flex-direction: column;
        gap: 8px;
    }
    .admin-actions .btn {
        width: 100%;
    }
}


/* ============================================================
   15. AUTH MODALI (index.html — Login/Register)
   ============================================================ */

@media (max-width: 768px) {
    .modal-content {
        width: 94%;
        margin: 5vh auto;
        padding: 26px 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    .modal-title {
        font-size: 1.3rem;
    }
    .captcha-container {
        flex-direction: column;
    }
    .captcha-box {
        width: 100%;
    }
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 97%;
        padding: 18px 14px;
        margin: 3vh auto;
        max-height: 94vh;
    }
    .modal-title {
        font-size: 1.15rem;
        margin-bottom: 14px;
        padding-bottom: 10px;
    }
    .form-group label {
        font-size: 0.85rem;
    }
    .form-group input {
        padding: 9px 12px;
        font-size: 0.88rem;
    }
}

@media (max-width: 360px) {
    .modal-content {
        padding: 14px 10px;
    }
    .btn {
        padding: 9px 14px;
        font-size: 0.82rem;
    }
}


/* ============================================================
   16. DIALOG + TOAST BILDIRIMLER
   ============================================================ */

@media (max-width: 480px) {
    .ente-dialog-box {
        width: 95%;
        padding: 20px 16px;
    }
    .ente-dialog-title {
        font-size: 1rem;
    }
    .ente-dialog-message {
        font-size: 0.85rem;
    }
    .ente-dialog-actions {
        flex-direction: column;
        gap: 8px;
    }
    .ente-dialog-btn {
        width: 100%;
    }
    .sys-notification {
        min-width: auto;
        width: calc(100vw - 24px);
        max-width: none;
        left: 12px !important;
        transform: translateX(0) translateY(-150%) !important;
    }
    .sys-notification.show {
        transform: translateX(0) translateY(0) !important;
    }
}


/* ============================================================
   17. FOOTER
   ============================================================ */

@media (max-width: 768px) {
    .footer-main {
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }
    .footer-left {
        flex-direction: column;
        align-items: center;
    }
    .footer-divider {
        width: 40px;
        height: 1px;
    }
    .footer-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    .footer-right {
        flex-direction: column;
        align-items: center;
    }
    .site-footer {
        padding: 16px;
    }
}


/* ============================================================
   18. GENEL YARDIMCI DUZELTMELER
   ============================================================ */

@media (max-width: 900px) {
    body {
        overflow-x: hidden;
    }
    img,
    video,
    iframe {
        max-width: 100%;
    }
}

@media (max-width: 360px) {
    .btn-group,
    .action-group {
        flex-direction: column;
        gap: 8px;
    }
    .btn-group .btn,
    .action-group .btn {
        width: 100%;
    }
}
