/* ============================================
   MOBILE-FRIENDLY RESPONSIVE STYLES
   File: /design/main/responsive.css
   ============================================ */

/* ============================================
   BASE RESPONSIVE SETTINGS
   ============================================ */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* ============================================
   TABLETS & SMALL LAPTOPS (max-width: 992px)
   ============================================ */
@media (max-width: 992px) {
    /* Typography */
    h1 { font-size: 28px; }
    h2 { font-size: 24px; }
    h3 { font-size: 20px; }
    h4 { font-size: 18px; }
    h5 { font-size: 16px; }
    h6 { font-size: 14px; }
    
    /* Containers */
    .container, .book-wrapper {
        padding-left: 20px;
        padding-right: 20px;
        width: 100%;
    }
    
    /* Navigation */
    .nav-links {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .nav-links a {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    /* Book Layout */
    .book-cover {
        padding: 15px;
    }
    
    .book-pages {
        padding: 15px;
    }
    
    .page-title h1 {
        font-size: 24px;
    }
    
    .page-title p {
        font-size: 14px;
    }
    
    /* Grid Layouts */
    .modular-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 15px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    /* Cards */
    .card {
        padding: 15px;
    }
    
    .card h3 {
        font-size: 16px;
    }
    
    .card p {
        font-size: 13px;
    }
    
    /* Forms */
    input, textarea, select {
        font-size: 16px !important; /* Prevents iOS zoom */
        padding: 10px 12px;
    }
    
    /* Buttons */
    .btn, button, .button {
        padding: 10px 20px;
        font-size: 14px;
        min-height: 44px; /* Touch-friendly */
        min-width: 44px;
    }
    
    /* Ribbon tabs */
    .ribbon-tab {
        font-size: 12px;
        padding: 10px 14px;
        min-height: 40px;
    }
    
    .ribbon-tab i {
        font-size: 14px;
    }
}

/* ============================================
   MOBILE PHONES (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    /* Typography */
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
    h4 { font-size: 16px; }
    h5 { font-size: 14px; }
    h6 { font-size: 13px; }
    
    body {
        font-size: 14px;
        line-height: 1.6;
    }
    
    /* Containers */
    .container, .book-wrapper {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Book Layout */
    .book-cover {
        padding: 10px;
        border-radius: 0;
    }
    
    .book-pages {
        padding: 10px;
        border-radius: 0;
    }
    
    .page-title {
        padding: 10px 0;
    }
    
    .page-title h1 {
        font-size: 20px;
    }
    
    .page-title h1 span {
        display: block;
    }
    
    .page-title p {
        font-size: 13px;
        flex-wrap: wrap;
    }
    
    .page-title .bookmark-icon {
        font-size: 14px;
    }
    
    /* Grid Layouts - Single Column for small screens */
    .modular-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .team-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    /* Cards */
    .card {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .card h3 {
        font-size: 15px;
    }
    
    .card p {
        font-size: 13px;
    }
    
    .card .card-image {
        height: 150px;
    }
    
    /* Navigation - Mobile Menu */
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #fff;
        padding: 15px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        position: absolute;
        top: 60px;
        left: 0;
        z-index: 999;
    }
    
    .nav-links.open {
        display: flex;
    }
    
    .nav-links a {
        padding: 12px 15px;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid #eee;
        font-size: 15px;
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
    
    .hamburger-btn {
        display: block !important;
        font-size: 24px;
        padding: 10px;
        background: none;
        border: none;
        cursor: pointer;
    }
    
    /* Dropdown on mobile */
    .dropdown {
        width: 100%;
        position: relative;
    }
    
    .dropdown .dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        background: #f5f5f5;
        display: none;
    }
    
    .dropdown.open .dropdown-menu {
        display: block;
    }
    
    /* Hero Slider */
    .hero-slider {
        height: 300px;
    }
    
    .hero-slide h2 {
        font-size: 22px;
    }
    
    .hero-slide p {
        font-size: 14px;
    }
    
    .hero-slide .btn {
        font-size: 14px;
        padding: 8px 20px;
    }
    
    /* Image Carousel */
    .image-carousel .slide {
        aspect-ratio: 4 / 3;
    }
    
    .carousel-arrow {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .carousel-dots .dot {
        width: 8px;
        height: 8px;
    }
    
    /* Newly Added Carousel */
    .newly-added-item {
        flex: 0 0 130px;
        height: 130px;
    }
    
    /* Video Carousel */
    .video-card {
        flex: 0 0 160px;
    }
    
    /* Ribbon Layout */
    .ribbon-container {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .ribbon-side {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        gap: 4px;
        overflow-x: auto;
        padding: 5px 0;
    }
    
    .ribbon-tab {
        flex: 0 0 auto;
        padding: 8px 14px;
        font-size: 11px;
        border-radius: 6px 6px 0 0;
        border: 1px solid #e8e8e8;
        border-bottom: none;
        text-align: center;
        justify-content: center;
        min-height: 34px;
        width: auto;
    }
    
    .ribbon-tab::after,
    .ribbon-tab::before {
        display: none;
    }
    
    .ribbon-tab.active {
        transform: translateY(-2px);
        border-bottom: 3px solid #c9a84c;
    }
    
    .ribbon-content-area {
        border-radius: 8px 8px 0 0;
        padding: 15px 15px;
    }
    
    .ribbon-content-area .category-header h2 {
        font-size: 18px;
    }
    
    .ribbon-content-area .category-header p {
        font-size: 13px;
    }
    
    /* Footer */
    .book-footer {
        padding: 15px 0;
        font-size: 12px;
    }
    
    .book-footer p {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* Modals */
    .image-modal .modal-container {
        max-width: 98%;
        padding: 5px;
    }
    
    .image-modal .modal-image-wrapper {
        max-height: 70vh;
    }
    
    .image-modal .modal-image-wrapper img {
        max-height: 70vh;
    }
    
    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 16px;
        top: 5px;
        right: 5px;
    }
    
    .modal-nav {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .modal-nav-left { left: 5px; }
    .modal-nav-right { right: 5px; }
    
    .modal-counter {
        font-size: 11px;
    }
    
    /* Video Modal */
    .video-modal-content {
        max-width: 98%;
        margin: 10px;
    }
    
    .video-modal-nav {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .video-modal-nav-left { left: 5px; }
    .video-modal-nav-right { right: 5px; }
    
    .video-modal-close {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .video-modal-info {
        padding: 8px 15px;
        font-size: 13px;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    /* Forms */
    form {
        width: 100%;
    }
    
    form .form-group {
        margin-bottom: 15px;
    }
    
    form label {
        font-size: 14px;
        display: block;
        margin-bottom: 5px;
    }
    
    form input,
    form textarea,
    form select {
        width: 100%;
        padding: 12px;
        font-size: 16px !important;
        border-radius: 6px;
        border: 1px solid #ddd;
    }
    
    form .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Tables */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
        font-size: 13px;
    }
    
    table th,
    table td {
        padding: 8px 10px;
    }
    
    /* Alerts */
    .alert {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    /* Sections */
    section {
        padding: 30px 0;
    }
    
    section .section-title {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    section .section-subtitle {
        font-size: 14px;
    }
    
    /* Sidebar */
    .sidebar {
        width: 100%;
        float: none;
        margin: 15px 0;
    }
    
    .main-content {
        width: 100%;
        float: none;
    }
    
    /* Floating Logo */
    .floating-logo {
        bottom: 15px;
        left: 15px;
    }
    
    .floating-logo img {
        width: 70px;
    }
    
    .floating-logo .logo-tooltip {
        display: none;
    }
    
    /* Floating Contact */
    .floating-contact {
        bottom: 15px;
        right: 15px;
    }
    
    .floating-contact .contact-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .floating-contact .contact-popup {
        width: 90vw;
        max-width: 340px;
        right: 0;
        bottom: 65px;
    }
}

/* ============================================
   SMALL MOBILE PHONES (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    /* Typography */
    h1 { font-size: 20px; }
    h2 { font-size: 18px; }
    h3 { font-size: 16px; }
    h4 { font-size: 14px; }
    h5 { font-size: 13px; }
    
    body {
        font-size: 13px;
    }
    
    /* Containers */
    .container, .book-wrapper {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Book Layout */
    .book-cover {
        padding: 5px;
    }
    
    .book-pages {
        padding: 8px;
    }
    
    .page-title h1 {
        font-size: 18px;
    }
    
    .page-title p {
        font-size: 12px;
    }
    
    /* Grid Layouts - 2 columns max */
    .modular-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* Cards */
    .card {
        padding: 10px;
    }
    
    .card .card-image {
        height: 120px;
    }
    
    .card h3 {
        font-size: 14px;
    }
    
    .card p {
        font-size: 12px;
    }
    
    .card .card-btn {
        font-size: 12px;
        padding: 6px 15px;
    }
    
    /* Modular Cards */
    .modular-card {
        padding: 10px;
    }
    
    .modular-card .modular-image {
        height: 100px;
    }
    
    .modular-card .modular-name {
        font-size: 13px;
    }
    
    .modular-card .modular-description {
        font-size: 11px;
    }
    
    .modular-card .modular-link {
        font-size: 10px;
        padding: 4px 14px;
    }
    
    /* Hero Slider */
    .hero-slider {
        height: 220px;
    }
    
    .hero-slide h2 {
        font-size: 18px;
    }
    
    .hero-slide p {
        font-size: 12px;
        padding: 0 10px;
    }
    
    .hero-slide .btn {
        font-size: 12px;
        padding: 6px 16px;
    }
    
    /* Image Carousel */
    .image-carousel .slide {
        aspect-ratio: 1 / 1;
    }
    
    .carousel-arrow {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .carousel-arrow-left { left: 5px; }
    .carousel-arrow-right { right: 5px; }
    
    .carousel-dots .dot {
        width: 6px;
        height: 6px;
        gap: 6px;
    }
    
    /* Newly Added Carousel */
    .newly-added-item {
        flex: 0 0 110px;
        height: 110px;
    }
    
    .newly-added-item .new-badge {
        font-size: 8px;
        padding: 1px 8px;
    }
    
    .newly-added-item .item-date {
        font-size: 8px;
        padding: 1px 8px;
    }
    
    /* Video Carousel */
    .video-card {
        flex: 0 0 140px;
    }
    
    .video-play-btn {
        font-size: 30px;
    }
    
    .video-card .video-info .video-date {
        font-size: 10px;
    }
    
    /* Carousel Buttons */
    .carousel-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .carousel-btn-left { left: -5px; }
    .carousel-btn-right { right: -5px; }
    
    .carousel-scroll-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .carousel-scroll-btn-left { left: -5px; }
    .carousel-scroll-btn-right { right: -5px; }
    
    /* Ribbon */
    .ribbon-tab {
        font-size: 10px;
        padding: 6px 10px;
        min-height: 28px;
    }
    
    .ribbon-tab i {
        font-size: 11px;
        min-width: 14px;
    }
    
    .ribbon-content-area {
        padding: 12px 12px;
    }
    
    .ribbon-content-area .category-header h2 {
        font-size: 16px;
    }
    
    .ribbon-content-area .category-header p {
        font-size: 12px;
    }
    
    /* Video Section */
    .video-section-header h2 {
        font-size: 16px;
    }
    
    .video-section-header .video-filter-group {
        width: 100%;
        justify-content: flex-start;
    }
    
    .video-section-header .video-filter-group select {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    /* All Modulars Header */
    .all-modulars-header h2 {
        font-size: 16px;
    }
    
    .all-modulars-header .modular-count {
        font-size: 12px;
    }
    
    /* Buttons */
    .btn, button, .button {
        padding: 8px 16px;
        font-size: 13px;
        min-height: 38px;
        min-width: 38px;
    }
    
    /* Forms */
    input, textarea, select {
        padding: 10px 12px;
        font-size: 16px !important;
    }
    
    /* Footer */
    .book-footer {
        padding: 12px 0;
        font-size: 11px;
    }
    
    .book-footer p {
        flex-direction: column;
        gap: 5px;
    }
    
    /* Modals */
    .image-modal {
        padding: 10px;
    }
    
    .image-modal .modal-image-wrapper {
        max-height: 60vh;
    }
    
    .image-modal .modal-image-wrapper img {
        max-height: 60vh;
    }
    
    .modal-close {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .modal-nav {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .image-overlay .watermark-text {
        font-size: 10px;
        bottom: 15px;
    }
    
    .image-overlay .close-btn {
        font-size: 30px;
        top: 15px;
        right: 20px;
    }
    
    /* Video Modal */
    .video-modal-nav {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .video-modal-close {
        width: 30px;
        height: 30px;
        font-size: 14px;
        top: 8px;
        right: 8px;
    }
    
    .video-modal-info {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* Floating Logo */
    .floating-logo img {
        width: 55px;
    }
    
    /* Floating Contact */
    .floating-contact .contact-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .floating-contact .contact-popup {
        width: 95vw;
        max-width: 300px;
        bottom: 55px;
    }
    
    /* Empty States */
    .empty-state {
        padding: 40px 15px;
    }
    
    .empty-state .empty-icon {
        font-size: 40px;
    }
    
    .empty-state h3 {
        font-size: 16px;
    }
    
    .empty-state p {
        font-size: 13px;
    }
    
    /* Breadcrumbs */
    .breadcrumb {
        font-size: 12px;
        padding: 8px 0;
    }
    
    /* Pagination */
    .pagination {
        font-size: 12px;
    }
    
    .pagination a,
    .pagination span {
        padding: 6px 10px;
        margin: 0 2px;
    }
}

/* ============================================
   VERY SMALL PHONES (max-width: 360px)
   ============================================ */
@media (max-width: 360px) {
    /* Grid - Single column */
    .modular-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .modular-card .modular-image {
        height: 140px;
    }
    
    /* Typography */
    h1 { font-size: 18px; }
    h2 { font-size: 16px; }
    h3 { font-size: 15px; }
    
    .page-title h1 {
        font-size: 16px;
    }
    
    /* Hero Slider */
    .hero-slider {
        height: 180px;
    }
    
    .hero-slide h2 {
        font-size: 16px;
    }
    
    .hero-slide p {
        font-size: 11px;
    }
    
    /* Newly Added */
    .newly-added-item {
        flex: 0 0 100px;
        height: 100px;
    }
    
    /* Video Cards */
    .video-card {
        flex: 0 0 130px;
    }
    
    /* Buttons */
    .btn, button, .button {
        padding: 6px 14px;
        font-size: 12px;
        min-height: 34px;
    }
}

/* ============================================
   LANDSCAPE ORIENTATION FIXES
   ============================================ */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-slider {
        height: 200px;
    }
    
    .hero-slide h2 {
        font-size: 20px;
    }
    
    .hero-slide p {
        font-size: 13px;
    }
    
    .image-modal .modal-image-wrapper {
        max-height: 60vh;
    }
    
    .image-modal .modal-image-wrapper img {
        max-height: 60vh;
    }
    
    .video-modal-container {
        padding-bottom: 50%;
    }
    
    .modular-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

/* ============================================
   TABLET PORTRAIT SPECIFIC (768px - 992px)
   ============================================ */
@media (min-width: 768px) and (max-width: 992px) and (orientation: portrait) {
    .modular-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .hero-slider {
        height: 350px;
    }
}

/* ============================================
   HIGH DPI / RETINA DISPLAYS
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .page-title h1 {
        font-weight: 700;
    }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12px;
        color: #000;
        background: #fff;
    }
    
    a {
        text-decoration: underline;
        color: #000;
    }
    
    img {
        max-width: 100% !important;
    }
}