/* ==========================================
   Responsive Styles
   ========================================== */

/* ========== Large Desktop (1400px+) ========== */
@media (min-width: 1400px) {
    .container-lg {
        max-width: 1400px;
    }

    .hero__quote {
        font-size: var(--font-size-4xl);
    }
}

/* ========== Desktop (1200px - 1399px) ========== */
@media (max-width: 1399px) {
    .admin__grid {
        gap: var(--space-6);
    }
}

/* ========== Tablet Landscape (1024px - 1199px) ========== */
@media (max-width: 1199px) {
    .top-thoughts__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer__links-group {
        gap: var(--space-10);
    }
}

/* ========== Tablet Portrait (768px - 1023px) ========== */
@media (max-width: 1023px) {
    :root {
        --font-size-4xl: 2.5rem;
        --font-size-3xl: 2rem;
        --font-size-2xl: 1.75rem;
    }

    .admin__grid {
        grid-template-columns: 1fr;
    }

    .admin__thoughts-list {
        max-height: 400px;
    }

    .top-thoughts__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }

    .library__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== Large Mobile (640px - 767px) ========== */
@media (max-width: 767px) {
    :root {
        --font-size-4xl: 2rem;
        --font-size-3xl: 1.75rem;
        --font-size-2xl: 1.5rem;
    }

    .container {
        padding: 0 var(--space-4);
    }

    /* Navigation */
    .nav__links {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: var(--space-10);
        gap: var(--space-8);
        background: var(--bg);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all var(--transition-smooth);
    }

    .nav__links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav__link {
        font-size: var(--font-size-lg);
    }

    .nav__menu-toggle {
        display: flex;
    }

    /* Hero */
    .hero__content {
        padding: var(--space-6);
    }

    .hero__quote {
        font-size: var(--font-size-2xl);
    }

    .hero__quote::before {
        font-size: 3rem;
    }

    .hero__author {
        font-size: var(--font-size-base);
    }

    /* Grids */
    .top-thoughts__grid,
    .library__grid {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer__main {
        flex-direction: column;
        gap: var(--space-8);
    }

    .footer__brand {
        max-width: 100%;
        text-align: center;
    }

    .footer__links-group {
        width: 100%;
        justify-content: space-between;
    }

    .footer__bottom {
        flex-direction: column;
        gap: var(--space-4);
    }

    /* Cards */
    .thought-card {
        padding: var(--space-6);
    }

    .thought-card__quote {
        font-size: var(--font-size-base);
    }

    /* Modals */
    .glass-modal {
        width: 95%;
        max-height: 85vh;
        padding: var(--space-6);
    }

    .download-modal__preview-card {
        padding: var(--space-6);
    }

    .download-modal__preview-quote {
        font-size: var(--font-size-lg);
    }

    /* Admin */
    .admin__header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }

    /* Feedback button position */
    .feedback-btn {
        bottom: var(--space-4);
        right: var(--space-4);
        width: 50px;
        height: 50px;
    }

    .scroll-top-btn {
        right: calc(var(--space-4) + 60px);
        width: 44px;
        height: 44px;
    }
}

/* ========== Small Mobile (480px and below) ========== */
@media (max-width: 480px) {
    :root {
        --font-size-4xl: 1.75rem;
        --font-size-3xl: 1.5rem;
        --font-size-2xl: 1.25rem;
        --font-size-xl: 1.125rem;
    }

    .container {
        padding: 0 var(--space-3);
    }

    /* Hero */
    .hero__quote {
        font-size: var(--font-size-xl);
    }

    .hero__quote::before {
        font-size: 2.5rem;
        margin-bottom: var(--space-2);
    }

    /* Sections */
    .top-thoughts {
        padding: var(--space-16) 0;
    }

    .top-thoughts__header {
        margin-bottom: var(--space-8);
    }

    /* Cards */
    .thought-card {
        padding: var(--space-5);
    }

    .thought-card__actions {
        flex-wrap: wrap;
    }

    /* Buttons */
    .neu-btn {
        padding: var(--space-3) var(--space-6);
        font-size: var(--font-size-sm);
    }

    .neu-btn-icon {
        width: 40px;
        height: 40px;
    }

    .neu-btn-icon svg {
        width: 18px;
        height: 18px;
    }

    /* Footer */
    .footer__links-group {
        flex-direction: column;
        gap: var(--space-6);
        text-align: center;
    }

    .footer__links {
        align-items: center;
    }

    /* Download modal backgrounds */
    .download-modal__bg-option {
        width: 40px;
        height: 40px;
    }

    /* Admin Panel */
    .login__card {
        padding: var(--space-6);
    }

    .admin__thought-item {
        flex-direction: column;
        gap: var(--space-3);
    }

    .admin__thought-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ========== Height-based adjustments ========== */
@media (max-height: 700px) {
    .hero__scroll-indicator {
        bottom: var(--space-6);
    }

    .hero__content {
        padding-top: var(--space-20);
    }
}

/* ========== Hover states for touch devices ========== */
@media (hover: none) {

    .neu-card:hover,
    .thought-card:hover,
    .glass-card:hover {
        transform: none;
        box-shadow: var(--neu-shadow), var(--neu-shadow-invert);
    }

    .hover-lift:hover,
    .hover-scale:hover {
        transform: none;
    }
}

/* ========== Dark mode specific responsive ========== */
@media (max-width: 767px) {
    [data-theme="dark"] .nav__links {
        background: var(--bg-dark);
    }
}

/* ========== Print styles ========== */
@media print {

    .nav,
    .footer,
    .feedback-btn,
    .scroll-top-btn,
    .thought-card__actions {
        display: none !important;
    }

    .hero {
        min-height: auto;
        padding: var(--space-8);
        background: white !important;
    }

    .hero__background {
        display: none;
    }

    .hero__quote {
        color: black !important;
        text-shadow: none;
    }

    .thought-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}