/* ================================================
   RESPONSIVE.CSS - Mobile & Tablet Styles
   ================================================ */

/* ============================================
   TABLET (768px and below)
   ============================================ */

@media (max-width: 768px) {
    /* Typography */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    /* Container */
    .container {
        padding: 0 16px;
    }

    /* Hero Section */
    .hero {
        padding: 60px 20px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    /* Item Grid */
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
        margin: 30px 0;
    }

    .item-card {
        border-radius: 8px;
    }

    .item-image-wrapper {
        padding-top: 100%; /* Square aspect ratio on mobile */
    }

    .item-content {
        padding: 12px;
    }

    .item-title {
        font-size: 1rem;
    }

    .item-description {
        font-size: 0.85rem;
    }

    .item-meta {
        font-size: 0.8rem;
        gap: 12px;
    }

    /* Category Grid */
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .category-card {
        padding: 24px 16px;
    }

    .category-icon {
        font-size: 2rem;
    }

    .category-name {
        font-size: 1.1rem;
    }

    .category-count {
        font-size: 0.8rem;
    }

    /* Navigation */
    .navbar {
        padding: 12px 0;
    }

    .nav-links {
        flex-direction: column;
        gap: 8px;
    }

    .nav-link {
        padding: 12px;
        width: 100%;
        text-align: center;
    }

    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }

    .item-actions {
        flex-direction: column;
        gap: 12px;
    }

    .item-actions .btn {
        width: 100%;
    }

    /* Search Bar */
    .search-bar {
        max-width: 100%;
    }

    .search-input {
        padding: 14px 45px 14px 16px;
        font-size: 0.95rem;
    }

    /* Pagination */
    .pagination {
        gap: 6px;
    }

    .page-link {
        min-width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        padding: 24px;
        border-radius: 12px;
    }

    /* Breadcrumb */
    .breadcrumb .container {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }

    /* Item Detail */
    .item-detail-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .item-stats-large {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .stat-box {
        padding: 12px;
    }

    .stat-box i {
        font-size: 1.5rem;
    }

    .stat-box strong {
        font-size: 1.1rem;
    }

    .stat-box span {
        font-size: 0.75rem;
    }

    /* Tags */
    .tag-item {
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    /* Footer */
    .footer {
        padding: 30px 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ============================================
   MOBILE (480px and below)
   ============================================ */

@media (max-width: 480px) {
    /* Typography */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Container */
    .container {
        padding: 0 12px;
    }

    /* Hero Section */
    .hero {
        padding: 40px 16px;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    /* Item Grid */
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
        margin: 20px 0;
    }

    .item-card {
        border-radius: 8px;
    }

    .item-badge {
        top: 8px;
        right: 8px;
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    .item-content {
        padding: 10px;
    }

    .item-title {
        font-size: 0.95rem;
        -webkit-line-clamp: 1;
    }

    .item-description {
        font-size: 0.8rem;
        -webkit-line-clamp: 1;
        margin-bottom: 8px;
    }

    .item-meta {
        font-size: 0.75rem;
        gap: 8px;
        padding-top: 8px;
    }

    /* Category Grid */
    .category-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .category-card {
        padding: 20px;
    }

    .category-icon {
        font-size: 2rem;
        margin-bottom: 12px;
    }

    .category-name {
        font-size: 1rem;
    }

    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    /* Search Bar */
    .search-input {
        padding: 12px 40px 12px 14px;
        font-size: 0.9rem;
    }

    .search-btn {
        width: 38px;
        height: 38px;
        right: 5px;
    }

    /* Pagination */
    .pagination {
        gap: 4px;
        flex-wrap: wrap;
    }

    .page-link {
        min-width: 32px;
        height: 32px;
        font-size: 0.85rem;
        padding: 0 8px;
    }

    /* Hide page numbers, show only prev/next on very small screens */
    .page-link:not(.prev):not(.next) {
        display: none;
    }

    .page-link.active,
    .page-link:nth-child(-n+3),
    .page-link:nth-last-child(-n+3) {
        display: flex;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        padding: 20px;
        border-radius: 10px;
    }

    .modal-content h3 {
        font-size: 1.25rem;
    }

    /* Breadcrumb */
    .breadcrumb {
        padding: 12px 0;
    }

    .breadcrumb .container {
        font-size: 0.8rem;
    }

    /* Item Detail */
    .item-detail-page {
        padding: 20px 0;
    }

    .main-image {
        border-radius: 8px;
    }

    .item-title {
        font-size: 1.5rem;
    }

    .item-stats-large {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .stat-box {
        padding: 10px;
    }

    .stat-box i {
        font-size: 1.25rem;
    }

    .stat-box strong {
        font-size: 1rem;
    }

    .stat-box span {
        font-size: 0.7rem;
    }

    .item-description {
        font-size: 0.9rem;
    }

    .details-grid {
        font-size: 0.9rem;
    }

    /* Tags */
    .tags-list {
        gap: 6px;
    }

    .tag-item {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    /* Footer */
    .footer {
        padding: 24px 0;
        font-size: 0.85rem;
    }

    .footer-grid {
        gap: 20px;
    }

    /* Navbar mobile menu */
    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #FFFFFF;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        padding: 16px;
        z-index: 100;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-link {
        padding: 12px;
        border-radius: 8px;
    }

    .nav-link:hover {
        background: #F5F5F5;
    }
}

/* ============================================
   LANDSCAPE MODE (Mobile Landscape)
   ============================================ */

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 30px 20px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .navbar,
    .footer,
    .btn,
    .search-bar,
    .pagination,
    .modal {
        display: none;
    }

    .item-card {
        break-inside: avoid;
    }

    body {
        background: #FFFFFF;
    }
}

/* ============================================
   DARK MODE SUPPORT (Optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #121212;
        --bg-secondary: #1E1E1E;
        --text-primary: #E0E0E0;
        --text-secondary: #B0B0B0;
    }

    /* Uncomment to enable dark mode
    body {
        background: var(--bg-primary);
        color: var(--text-primary);
    }

    .item-card {
        background: var(--bg-secondary);
    }

    .item-title {
        color: var(--text-primary);
    }

    .item-description {
        color: var(--text-secondary);
    }
    */
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */

@media (prefers-contrast: high) {
    .item-card {
        border: 2px solid #000000;
    }

    .btn {
        border: 2px solid currentColor;
    }

    a {
        text-decoration: underline;
    }
}
