/* ============================================
   CBRIAN - Responsive Stylesheet
   ============================================ */

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    :root {
        --container-max: 1320px;
    }

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

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

/* Desktop (1200px - 1439px) */
@media (max-width: 1439px) {
    .footer-grid {
        gap: 40px;
    }
}

/* Tablet Landscape (1024px - 1199px) */
@media (max-width: 1199px) {
    :root {
        --section-padding: 80px 0;
    }

    /* Services */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* About */
    .about-grid {
        gap: 50px;
    }

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

    /* Timeline */
    .timeline-content {
        max-width: calc(50% - 40px);
    }

    /* Tech Grid */
    .tech-grid {
        gap: 24px;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
        gap: 30px;
    }
}

/* Tablet Portrait (768px - 1023px) */
@media (max-width: 1023px) {
    :root {
        --section-padding: 70px 0;
    }

    /* Navigation */
    .nav-menu,
    .nav-cta {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    /* Hero */
    .hero-logo img {
        height: 160px;
    }

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

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

    /* Services */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .service-card {
        padding: 30px 24px;
    }

    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-image {
        max-width: 450px;
        margin: 0 auto;
    }

    .about-content {
        text-align: center;
    }

    .about-content .section-tag {
        text-align: center;
    }

    .about-content .section-tag::before {
        left: 50%;
        transform: translateX(-50%);
    }

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

    .btn-linkedin {
        margin: 0 auto;
    }

    /* Timeline - Vertical on tablet */
    .timeline::before {
        left: 30px;
    }

    .timeline-item {
        flex-direction: row !important;
        padding-left: 80px;
    }

    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        text-align: left;
        padding-left: 0;
        padding-right: 0;
        max-width: 100%;
    }

    .timeline-item:nth-child(odd) .timeline-icon {
        margin-left: 0;
    }

    .timeline-number {
        left: 30px;
        transform: translateX(-50%);
    }

    /* Tech Grid */
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .contact-info {
        text-align: center;
    }

    .contact-info .section-tag {
        text-align: center;
    }

    .contact-info .section-tag::before {
        left: 50%;
        transform: translateX(-50%);
    }

    .contact-details {
        display: inline-flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .contact-schedule {
        display: inline-flex;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }

    .footer-brand {
        grid-column: span 2;
        text-align: center;
    }

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

/* Mobile Landscape (640px - 767px) */
@media (max-width: 767px) {
    :root {
        --section-padding: 60px 0;
    }

    /* Fix horizontal scroll on mobile */
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    body {
        position: relative;
    }

    /* Section Headers */
    .section-header {
        margin-bottom: 40px;
    }

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

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

    /* Buttons */
    .btn {
        padding: 12px 24px;
        font-size: 0.9375rem;
    }

    /* Hero */
    .hero-logo img {
        height: 140px;
    }

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

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 280px;
    }

    .scroll-indicator {
        bottom: 20px;
    }

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

    /* About Stats */
    .about-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 24px;
    }

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

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

    /* Timeline */
    .timeline-item {
        margin-bottom: 40px;
        padding-left: 70px;
    }

    .timeline::before {
        left: 25px;
    }

    .timeline-number {
        left: 25px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .timeline-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

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

    /* Testimonials */
    .testimonial-card {
        padding: 30px 24px;
    }

    .testimonial-text {
        font-size: 1rem;
    }

    .swiper-button-prev,
    .swiper-button-next {
        display: none;
    }

    /* Tech Grid */
    .tech-grid {
        grid-template-columns: 1fr;
    }

    .tech-category {
        padding: 24px;
    }

    /* Contact */
    .contact-form {
        padding: 30px 24px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

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

    .footer-brand {
        grid-column: span 1;
    }

    .footer-links,
    .footer-services,
    .footer-contact {
        text-align: center;
    }

    .footer-contact ul li {
        justify-content: center;
    }

    .footer-bottom .container {
        flex-direction: column;
        text-align: center;
    }

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

    /* WhatsApp & Back to Top */
    .whatsapp-btn {
        width: 55px;
        height: 55px;
        bottom: 20px;
        right: 20px;
        max-width: none;
    }

    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 85px;
        right: 20px;
        max-width: none;
    }

    /* Prevent horizontal scroll */
    .hero, .section {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .particles-container {
        max-width: 100vw;
        overflow: hidden;
    }
}

/* Mobile Portrait (< 640px) */
@media (max-width: 639px) {
    :root {
        --section-padding: 50px 0;
    }

    html {
        font-size: 15px;
    }

    /* Fix horizontal scroll on mobile */
    html, body {
        overflow-x: hidden !important;
        width: 100%;
        max-width: 100vw;
    }

    body {
        position: relative;
    }

    * {
        max-width: 100%;
    }

    /* Container */
    .container {
        padding: 0 16px;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Prevent horizontal scroll */
    .hero, .section {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .particles-container {
        max-width: 100vw;
        overflow: hidden;
    }

    .hero-content {
        max-width: 100vw;
    }

    /* Header */
    .navbar {
        padding: 15px 0;
    }

    .nav-container {
        max-width: 100%;
    }

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

    /* Hero */
    .hero-content {
        padding: 0 16px;
    }

    .hero-logo img {
        height: 130px;
    }

    .hero-title {
        font-size: 1.625rem;
        margin-bottom: 16px;
    }

    .hero-subtitle {
        font-size: 0.9375rem;
        margin-bottom: 30px;
    }

    /* Service Cards */
    .service-card {
        padding: 24px 20px;
    }

    .service-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 20px;
    }

    .service-title {
        font-size: 1.125rem;
    }

    .service-description {
        font-size: 0.875rem;
    }

    /* About */
    .about-name {
        font-size: 1.75rem;
    }

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

    .about-bio p {
        font-size: 0.9375rem;
    }

    .about-stats {
        padding: 20px 16px;
    }

    /* Timeline */
    .timeline-item {
        padding-left: 60px;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-number {
        left: 20px;
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }

    .timeline-icon {
        width: 45px;
        height: 45px;
        font-size: 1.125rem;
        margin-bottom: 16px;
    }

    .timeline-content h3 {
        font-size: 1.125rem;
        margin-bottom: 8px;
    }

    .timeline-content p {
        font-size: 0.875rem;
    }

    /* Testimonials */
    .testimonials-slider {
        padding: 20px 10px;
    }

    .testimonial-card {
        padding: 24px 20px;
    }

    .testimonial-quote {
        font-size: 2rem;
        top: 20px;
        right: 20px;
    }

    .testimonial-metric {
        padding: 10px 16px;
    }

    .metric-value {
        font-size: 1.25rem;
    }

    .author-avatar {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    /* Contact */
    .contact-title {
        font-size: 1.5rem;
    }

    .contact-subtitle {
        font-size: 0.9375rem;
    }

    .contact-icon {
        width: 45px;
        height: 45px;
    }

    .contact-form {
        padding: 24px 20px;
    }

    .form-group label {
        font-size: 0.8125rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 14px;
        font-size: 0.9375rem;
    }

    /* Footer */
    .footer-top {
        padding: 50px 0 40px;
    }

    .footer-logo {
        height: 40px;
    }

    .footer-grid {
        gap: 30px;
    }

    .footer-links h4,
    .footer-services h4,
    .footer-contact h4 {
        font-size: 0.9375rem;
        margin-bottom: 16px;
    }

    .footer-links ul a,
    .footer-services ul a,
    .footer-contact ul li {
        font-size: 0.875rem;
    }

    .footer-bottom {
        padding: 20px 0;
    }

    .footer-bottom p {
        font-size: 0.8125rem;
    }

    .footer-legal a {
        font-size: 0.8125rem;
    }
}

/* Extra Small Devices (< 375px) */
@media (max-width: 374px) {
    html {
        font-size: 14px;
    }

    .hero-logo img {
        height: 110px;
    }

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

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

    .stat-item {
        padding: 8px 0;
    }

    .tech-items {
        justify-content: center;
    }

    .tech-item {
        padding: 8px 14px;
        font-size: 0.8125rem;
    }
}

/* Touch Device Specific */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects that don't work well on touch */
    .service-card:hover {
        transform: none;
    }

    .btn-primary:hover {
        transform: none;
    }

    .nav-link::after {
        display: none;
    }

    /* Increase tap targets */
    .nav-link,
    .mobile-link {
        padding: 10px;
    }

    .footer-links ul a,
    .footer-services ul a {
        padding: 8px 0;
        display: block;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Use higher resolution images if available */
    .hero-bg-overlay {
        background-image: url('../images/backgrounds/hero-bg.png');
    }
}

/* Print Styles */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }

    #header,
    .scroll-indicator,
    .whatsapp-btn,
    .back-to-top,
    #preloader,
    .particles-container {
        display: none !important;
    }

    .hero {
        min-height: auto;
        padding: 40px 0;
    }

    .section {
        padding: 40px 0;
        page-break-inside: avoid;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }

    .btn {
        border: 1px solid black;
    }
}

/* Landscape Orientation on Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px 0;
    }

    .hero-logo img {
        height: 70px;
    }

    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }

    .hero-subtitle {
        margin-bottom: 20px;
    }

    .scroll-indicator {
        display: none;
    }

    .mobile-menu {
        padding: 60px 20px 20px;
        overflow-y: auto;
    }

    .mobile-nav li {
        margin: 12px 0;
    }

    .mobile-link {
        font-size: 1.25rem;
    }
}

/* Dark Mode System Preference */
@media (prefers-color-scheme: dark) {
    /* Already dark by default, but can add adjustments here */
}

/* Focus Visible for Accessibility */
@media (scripting: enabled) {
    :focus:not(:focus-visible) {
        outline: none;
    }

    :focus-visible {
        outline: 2px solid var(--color-secondary);
        outline-offset: 2px;
    }
}
