/* Mobile First Responsive Design */
@media (max-width: 640px) {
    .viewer-height {
        height: 50vh;
        border-radius: 12px;
    }

    .button-mobile, .input-mobile {
        font-size: 16px; /* Prevents iOS zoom */
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .lg\\:flex-row {
        flex-direction: column;
        gap: 1rem;
    }

    .lg\\:space-x-4 > *:not(:last-child) {
        margin-bottom: 1rem;
    }

    .bookmark-item,
    .stats-card {
        width: 100px;
        height: 100px;
        font-size: 0.8rem;
    }

    .stats-icon {
        font-size: 1.2rem;
    }

    .stats-number {
        font-size: 1rem;
    }

    #activityLog {
        max-height: 200px;
        font-size: 0.75rem;
        padding: 1rem;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }

    #urlInput {
        font-size: 16px;
        padding: 1rem;
    }

    #addBookmarkModal .bg-gray-800 {
        margin: 1rem;
        padding: 2rem;
    }

    .bookmark-item {
        padding: 1.5rem;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .viewer-height {
        height: 60vh;
    }

    .hero-section h1 {
        font-size: 3rem;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .bookmark-item,
    .stats-card {
        width: 110px;
        height: 110px;
    }

    .stats-grid {
        gap: 1rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .bookmark-item,
    .stats-card {
        width: 140px;
        height: 140px;
    }

    .stats-grid {
        gap: 1rem;
    }
}

@media (min-width: 1025px) {
    .bookmark-item,
    .stats-card {
        width: 150px;
        height: 150px;
    }

    .stats-grid {
        gap: 1rem;
    }

    .hero-section h1 {
        font-size: 4rem;
    }

    .section-title {
        font-size: 3rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .bookmark-item, .stats-grid > div, #activityLog {
        border-width: 0.5px;
    }
}

/* Dark mode support for browsers */
@media (prefers-color-scheme: dark) {
    /* Already using dark theme */
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .fade-in,
    .bookmark-item,
    .btn-primary,
    .btn-secondary,
    #urlInput,
    .loading-spinner {
        transition: none;
        animation: none;
    }

    .bookmark-item:hover {
        transform: none;
    }

    .loading-spinner {
        animation: none;
        border-top-color: var(--primary-blue);
    }
}