/**
 * Responsive Styles
 * Additional responsive adjustments for all devices
 * Optimized for iPhone 16/17 and Samsung Galaxy S25 Ultra
 *
 * @package CYC_Theme
 */

/* =====================================================
   LARGE SCREENS (1400px+)
   ===================================================== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    .hero-title {
        font-size: 4.5rem;
    }

    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* =====================================================
   DESKTOP (1200px - 1399px)
   ===================================================== */
@media (max-width: 1399px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =====================================================
   LARGE TABLETS / SMALL DESKTOPS (992px - 1199px)
   ===================================================== */
@media (max-width: 1199px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =====================================================
   TABLETS (768px - 991px)
   ===================================================== */
@media (max-width: 991px) {
    :root {
        --header-height: 70px;
    }

    /* Navigation hidden on tablets */
    .main-nav .nav-menu {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Grid adjustments */
    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-image {
        order: -1;
        max-height: 400px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .service-detail-grid {
        grid-template-columns: 1fr;
    }

    .team-page-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Hero adjustments */
    .hero-title {
        font-size: clamp(2.5rem, 6vw, 3.5rem);
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }
}

/* =====================================================
   MOBILE - GENERAL (576px - 767px)
   ===================================================== */
@media (max-width: 767px) {
    /* Container padding */
    .container {
        padding: 0 1rem;
    }

    /* Typography */
    h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
    h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
    h3 { font-size: clamp(1.25rem, 3.5vw, 1.5rem); }

    /* Hero */
    .hero {
        min-height: calc(100vh - 60px);
        padding: 0 1rem;
    }

    .hero-content {
        padding: 1.5rem;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }

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

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-scroll {
        display: none;
    }

    /* Stats */
    .stats-container {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        margin-top: -40px;
    }

    .stat-number {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }

    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: 1.5rem;
    }

    /* Team */
    .team-grid {
        grid-template-columns: 1fr;
    }

    .team-page-grid {
        grid-template-columns: 1fr;
    }

    /* Blog */
    .blog-grid,
    .blog-page-grid {
        grid-template-columns: 1fr;
    }

    .blog-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Contact */
    .form-row {
        grid-template-columns: 1fr;
    }

    .contact-form-wrapper {
        padding: 1.5rem;
    }

    /* Footer */
    .footer-main {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        max-width: 100%;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Chatbot */
    .catalina-window {
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        bottom: 0;
        right: 0;
    }

    .catalina-trigger {
        width: 56px;
        height: 56px;
    }

    .catalina-chatbot {
        bottom: 16px;
        right: 16px;
    }

    /* WhatsApp button */
    .whatsapp-float {
        bottom: 80px !important;
        right: 16px !important;
        width: 46px !important;
        height: 46px !important;
    }
}

/* =====================================================
   SMALL MOBILE (430px - 575px) - iPhone 16 Pro Max Size
   ===================================================== */
@media (max-width: 575px) and (min-width: 430px) {
    .header-inner {
        padding: 0 1rem;
    }

    .site-logo img {
        height: 45px;
    }

    .header-cta {
        padding: 0.5rem 1rem;
        font-size: 0.7rem;
    }

    .language-toggle span {
        display: none;
    }

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

    .about-features {
        grid-template-columns: 1fr;
    }

    .service-features {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   iPhone 16 / iPhone 17 Specific (390px - 430px)
   ===================================================== */
@media (max-width: 430px) and (min-width: 375px) {
    :root {
        --header-height: 65px;
    }

    .container {
        padding: 0 0.875rem;
    }

    /* Header adjustments */
    .header-inner {
        padding: 0 0.875rem;
    }

    .site-logo img {
        height: 40px;
    }

    .header-cta {
        padding: 0.4rem 0.8rem;
        font-size: 0.65rem;
        letter-spacing: 0.04em;
    }

    /* Hero */
    .hero-title {
        font-size: 1.875rem;
        line-height: 1.15;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .hero-badge {
        font-size: 0.7rem;
    }

    /* Buttons */
    .btn--large {
        padding: 0.75rem 1.5rem;
        font-size: 0.8rem;
    }

    /* Stats */
    .stats-container {
        margin-top: -30px;
        padding: 1.25rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.875rem;
    }

    /* Section titles */
    .section-title {
        font-size: 1.5rem;
    }

    .section-label {
        font-size: 0.75rem;
    }

    /* Cards */
    .service-card,
    .blog-card-content,
    .team-card-content {
        padding: 1.25rem;
    }

    /* Chatbot adjustments */
    .catalina-chatbot {
        bottom: 12px;
        right: 12px;
    }

    .catalina-trigger {
        width: 52px;
        height: 52px;
    }

    .catalina-messages {
        padding: 1rem;
    }

    .message-bubble {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .lawyer-option {
        padding: 0.75rem;
    }

    .lawyer-option-avatar {
        width: 45px;
        height: 45px;
    }

    /* Footer */
    .footer-column h4 {
        font-size: 0.9rem;
    }

    .footer-contact-item {
        font-size: 0.8rem;
    }
}

/* =====================================================
   Samsung Galaxy S25 Ultra (412px width, tall display)
   ===================================================== */
@media (max-width: 412px) and (min-height: 800px) {
    /* Safe area for dynamic island */
    .site-header {
        padding-top: env(safe-area-inset-top, 0px);
    }

    .hero {
        padding-top: calc(var(--header-height) + env(safe-area-inset-top, 20px));
    }

    /* Bottom safe area for gesture navigation */
    .catalina-window {
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }

    .site-footer {
        padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    }

    /* Adjust for taller viewport */
    .hero {
        min-height: 100svh;
    }

    .hero-content {
        padding-top: 2rem;
        padding-bottom: 3rem;
    }
}

/* =====================================================
   VERY SMALL PHONES (< 375px)
   ===================================================== */
@media (max-width: 374px) {
    :root {
        --header-height: 60px;
    }

    .container {
        padding: 0 0.75rem;
    }

    /* Hide header CTA on very small screens */
    .header-cta {
        display: none;
    }

    .language-toggle {
        padding: 0.25rem 0.5rem;
    }

    .language-toggle span {
        display: none;
    }

    /* Hero */
    .hero-title {
        font-size: 1.625rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .hero-badge {
        display: none;
    }

    /* Buttons */
    .btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.75rem;
    }

    /* Stats */
    .stat-number {
        font-size: 1.75rem;
    }

    /* Section titles */
    .section-title {
        font-size: 1.375rem;
    }

    /* Chatbot */
    .catalina-trigger {
        width: 48px;
        height: 48px;
    }

    .catalina-header {
        padding: 1rem;
    }

    .catalina-avatar {
        width: 40px;
        height: 40px;
    }
}

/* =====================================================
   LANDSCAPE MOBILE
   ===================================================== */
@media (max-width: 991px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 6rem 0 3rem;
    }

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

    .hero-scroll {
        display: none;
    }

    .catalina-window {
        max-height: 80vh;
    }
}

/* =====================================================
   HIGH DPI / RETINA DISPLAYS
   ===================================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .site-logo img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* =====================================================
   TOUCH DEVICE SPECIFIC
   ===================================================== */
@media (hover: none) and (pointer: coarse) {
    /* Increase tap targets */
    .nav-menu a,
    .mobile-nav-menu a,
    .footer-column a,
    .quick-reply,
    .time-slot,
    .calendar-day:not(.disabled) {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Remove hover effects that don't work well on touch */
    .btn::before {
        display: none;
    }

    .service-card:hover,
    .team-card:hover,
    .blog-card:hover {
        transform: none;
    }

    /* Better touch feedback */
    .btn:active,
    .quick-reply:active,
    .service-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* =====================================================
   ACCESSIBILITY - REDUCED MOTION
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-particle {
        display: none;
    }

    .catalina-pulse {
        animation: none;
    }

    .typing-indicator span {
        animation: none;
    }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    .site-header,
    .site-footer,
    .catalina-chatbot,
    .whatsapp-float,
    .mobile-nav,
    .hero-scroll,
    .hero-actions,
    .btn {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    .hero {
        min-height: auto;
        padding: 2rem 0;
        background: none !important;
    }

    .hero-title,
    .hero-subtitle {
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .section-title {
        page-break-after: avoid;
    }

    .service-card,
    .team-card,
    .blog-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* =====================================================
   PAGINATION STYLES
   ===================================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border: 1px solid var(--cyc-light-gray);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    transition: all var(--transition-fast);
}

.pagination .page-numbers:hover {
    border-color: var(--cyc-secondary);
    color: var(--cyc-secondary);
}

.pagination .page-numbers.current {
    background: var(--cyc-secondary);
    border-color: var(--cyc-secondary);
    color: var(--cyc-white);
}

.pagination .prev,
.pagination .next {
    font-weight: 600;
}

/* =====================================================
   BREADCRUMB STYLES
   ===================================================== */
.breadcrumbs {
    font-size: var(--fs-sm);
    color: var(--cyc-medium-gray);
    margin-bottom: 1.5rem;
}

.breadcrumbs a {
    color: var(--cyc-medium-gray);
    transition: color var(--transition-fast);
}

.breadcrumbs a:hover {
    color: var(--cyc-secondary);
}

.breadcrumbs .separator {
    margin: 0 0.5rem;
    opacity: 0.5;
}

.breadcrumbs .current {
    color: var(--cyc-primary);
}
