/* responsive.css - Mobile-first responsive styles */

/* === Base Responsive Styles === */
@media screen and (max-width: 1200px) {
    .nav-container,
    .hero-content,
    .stream-container,
    .couple-container,
    .gallery-container,
    .schedule-container,
    .rsvp-container,
    .gifts-container,
    .photos-container,
    .footer-content,
    .footer-bottom {
        max-width: 95%;
        padding: 0 15px;
    }
    
    .couple-name {
        font-size: 3.5rem;
    }
    
    .video-chat-container {
        gap: 20px;
    }
}

/* === Tablet Devices (768px - 1024px) === */
@media screen and (max-width: 1024px) {
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 30px 20px;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
        z-index: 999;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        gap: 15px;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        padding: 15px 20px;
        text-align: center;
        width: 100%;
        font-size: 1.1rem;
        border-radius: 12px;
        margin: 5px 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .user-greeting {
        display: none;
    }
    
    .btn-login {
        justify-content: center;
        width: 100%;
        margin: 5px 0;
    }
    
    /* Hero Section */
    .hero {
        padding: 160px 20px 80px;
        min-height: auto;
    }
    
    .couple-name {
        font-size: 3rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .heart-icon {
        margin: 10px 0;
        transform: rotate(90deg);
    }
    
    .date-location {
        flex-direction: column;
        gap: 15px;
    }
    
    .wedding-date,
    .wedding-location {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .countdown-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .countdown-separator {
        display: none;
    }
    
    .countdown-box {
        min-width: 80px;
        padding: 15px;
    }
    
    .countdown-box span {
        font-size: 2rem;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    /* Live Stream Section */
    .video-chat-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .stream-status-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .stream-quality select {
        width: 100%;
    }
    
    /* Couple Section */
    .couple-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .heart-connection {
        order: -1;
        margin: 0 auto 20px;
    }
    
    .couple-img {
        width: 220px;
        height: 220px;
    }
    
    /* Love Story Timeline */
    .story-timeline::before {
        left: 25px;
    }
    
    .story-item {
        padding-left: 60px;
    }
    
    .story-date {
        min-width: 60px;
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    /* Schedule */
    .schedule-notes {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* RSVP */
    .rsvp-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .attendance-options {
        flex-direction: column;
    }
    
    .radio-option {
        width: 100%;
    }
    
    /* Gifts */
    .gift-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .footer-links {
        flex-wrap: wrap;
        gap: 15px;
    }
}

/* === Mobile Devices (576px - 768px) === */
@media screen and (max-width: 768px) {
    /* Typography */
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    h3 {
        font-size: 1.4rem;
    }
    
    .section-header h2 {
        font-size: 2.2rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    /* Hero Section */
    .hero {
        padding: 140px 15px 60px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .couple-name {
        font-size: 2.5rem;
    }
    
    .countdown-box {
        min-width: 70px;
        padding: 12px;
    }
    
    .countdown-box span {
        font-size: 1.8rem;
    }
    
    .countdown-box p {
        font-size: 0.8rem;
    }
    
    /* Stream Section */
    .stream-container {
        padding: 20px;
    }
    
    .stream-placeholder h3 {
        font-size: 1.5rem;
    }
    
    .stream-info {
        padding: 15px;
    }
    
    .chat-section {
        height: 500px;
    }
    
    .chat-input-container {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .user-avatar-chat {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    /* Couple Section */
    .couple-img {
        width: 180px;
        height: 180px;
    }
    
    .couple-bio h3 {
        font-size: 1.8rem;
    }
    
    .title {
        font-size: 1rem;
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .gallery-filter {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .filter-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    /* Schedule */
    .schedule-notes {
        grid-template-columns: 1fr;
    }
    
    .note-box {
        padding: 20px;
    }
    
    /* RSVP */
    .rsvp-form,
    .rsvp-confirmed,
    .rsvp-login {
        padding: 30px 20px;
    }
    
    .rsvp-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-box {
        padding: 20px;
    }
    
    /* Gifts */
    .gift-options {
        grid-template-columns: 1fr;
    }
    
    .gifts-intro {
        padding: 20px;
    }
    
    /* Photos */
    .upload-area {
        padding: 40px 20px;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    /* Footer */
    .footer {
        padding: 40px 15px 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .newsletter-input {
        max-width: 300px;
        margin: 0 auto;
    }
    
    .footer-bottom {
        padding-top: 20px;
    }
}

/* === Small Mobile Devices (up to 576px) === */
@media screen and (max-width: 576px) {
    /* Navigation */
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .logo-subtitle {
        font-size: 0.8rem;
    }
    
    /* Hero Section */
    .hero {
        padding: 130px 10px 50px;
    }
    
    .couple-name {
        font-size: 2rem;
    }
    
    .date-location p {
        font-size: 1rem;
        padding: 12px 20px;
    }
    
    .countdown-box {
        min-width: 60px;
        padding: 10px;
    }
    
    .countdown-box span {
        font-size: 1.5rem;
    }
    
    /* Stream Section */
    .stream-container {
        padding: 15px;
        border-radius: 15px;
    }
    
    .stream-status-bar {
        padding: 12px 15px;
    }
    
    .video-container {
        padding: 0;
    }
    
    .chat-header {
        padding: 15px;
    }
    
    .chat-box {
        padding: 15px;
    }
    
    .message {
        padding: 12px;
    }
    
    /* Couple Section */
    .couple-container {
        gap: 30px;
    }
    
    .couple-img {
        width: 150px;
        height: 150px;
    }
    
    .couple-bio {
        padding: 0 10px;
    }
    
    .couple-bio h3 {
        font-size: 1.6rem;
    }
    
    .heart-animation {
        font-size: 3rem;
    }
    
    .love-story {
        padding: 30px 20px;
    }
    
    /* Gallery */
    .gallery-container {
        padding: 0 10px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    /* Schedule */
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        padding-left: 50px;
    }
    
    .timeline-time {
        min-width: 70px;
        padding: 6px 10px;
        font-size: 0.9rem;
    }
    
    .timeline-content {
        padding: 20px;
    }
    
    /* RSVP */
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .login-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
    
    /* Modals */
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-lg {
        width: 98%;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    /* Utility Classes */
    .mt-5 { margin-top: 2rem; }
    .mb-5 { margin-bottom: 2rem; }
    .p-5 { padding: 2rem; }
}

/* === Extra Small Devices (up to 400px) === */
@media screen and (max-width: 400px) {
    /* Base */
    body {
        font-size: 14px;
    }
    
    /* Hero */
    .couple-name {
        font-size: 1.8rem;
    }
    
    .hero-title {
        font-size: 1.3rem;
    }
    
    .countdown-box {
        min-width: 55px;
        padding: 8px;
    }
    
    .countdown-box span {
        font-size: 1.3rem;
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    /* Modals */
    .modal-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        padding: 15px;
    }
}

/* === Landscape Orientation === */
@media screen and (max-height: 600px) and (orientation: landscape) {
    /* Hero Section */
    .hero {
        padding: 100px 20px 50px;
        min-height: auto;
    }
    
    .couple-name {
        font-size: 2.5rem;
        margin: 10px 0;
    }
    
    .date-location {
        margin: 20px 0;
    }
    
    .countdown {
        margin: 30px 0;
    }
    
    /* Navigation */
    .nav-menu {
        max-height: 300px;
        overflow-y: auto;
    }
    
    /* Chat Section */
    .chat-section {
        height: 300px;
    }
    
    /* Modals */
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-body {
        max-height: 50vh;
    }
}

/* === Print Styles === */
@media print {
    /* Hide unnecessary elements */
    .navbar,
    .chat-section,
    .hero-actions,
    .scroll-indicator,
    .footer,
    .btn-primary,
    .btn-secondary,
    .gallery-filter,
    .stream-controls,
    .modal,
    .notification {
        display: none !important;
    }
    
    /* Base print styles */
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .animated-bg {
        display: none;
    }
    
    /* Section spacing for print */
    section {
        padding: 20px 0 !important;
        margin: 0 !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    /* Hero section print styles */
    .hero {
        padding: 50px 0 !important;
        background: white !important;
        color: black !important;
        text-align: center;
    }
    
    .couple-name {
        color: black !important;
        background: none !important;
        -webkit-text-fill-color: black !important;
        font-size: 24pt !important;
    }
    
    .countdown-box {
        background: white !important;
        border: 1px solid #ccc !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    /* Image adjustments */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Link adjustments */
    a {
        color: black !important;
        text-decoration: underline;
    }
    
    /* Remove animations and transitions */
    * {
        animation: none !important;
        transition: none !important;
    }
    
    /* Page breaks */
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .section-header {
        page-break-before: always;
    }
    
    /* Footer for print */
    .footer {
        position: relative !important;
        background: white !important;
        color: black !important;
        border-top: 1px solid #ccc;
        padding: 20px 0 !important;
    }
    
    /* Utility for print */
    .no-print {
        display: none !important;
    }
}

/* === High DPI Screens (Retina) === */
@media 
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-resolution: 192dpi),
only screen and (min-resolution: 2dppx) {
    /* Crisper borders and shadows */
    .navbar {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    /* Sharper text */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Crisper images */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* === Touch Device Optimizations === */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-link,
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-login,
    .filter-btn,
    .chat-action-btn,
    .stream-control-btn,
    .emoji-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects */
    .nav-link:hover,
    .btn:hover,
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none !important;
    }
    
    /* Better scrolling */
    .chat-box,
    .modal-body {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Disable text selection on interactive elements */
    .btn,
    .nav-link,
    .filter-btn {
        user-select: none;
        -webkit-user-select: none;
    }
    
    /* Prevent zoom on input focus */
    input,
    select,
    textarea {
        font-size: 16px; /* Prevents iOS zoom */
    }
}

/* === 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;
    }
    
    .animated-bg {
        animation: none !important;
    }
    
    .floating-hearts i,
    .floating-flowers i {
        animation: none !important;
    }
    
    .heart-icon,
    .live-dot.pulsing,
    .badge-live i,
    .heart-animation {
        animation: none !important;
    }
    
    .countdown-box,
    .scroll-indicator {
        animation: none !important;
    }
    
    .notification {
        animation: none !important;
        transition: none !important;
    }
}

/* === High Contrast Mode === */
@media (prefers-contrast: high) {
    :root {
        --primary: #d5006d;
        --secondary: #4a2c8c;
        --accent: #ffaa00;
        --dark: #000000;
        --light: #ffffff;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-login {
        border: 2px solid var(--dark);
    }
    
    .nav-link.active {
        outline: 2px solid var(--dark);
        outline-offset: -2px;
    }
    
    .countdown-box {
        border: 2px solid var(--dark);
    }
}

/* === Dark Mode Support === */
@media (prefers-color-scheme: dark) {
    :root {
        --dark: #f8f9fa;
        --light: #1a1a2e;
        --gray-100: #2a2a3c;
        --gray-200: #3a3a4c;
        --gray-300: #4a4a5c;
        --gray-400: #5a5a6c;
        --gray-500: #6c757d;
        --gray-600: #adb5bd;
        --gray-700: #ced4da;
        --gray-800: #dee2e6;
        --gray-900: #e9ecef;
    }
    
    body {
        background: var(--light);
        color: var(--dark);
    }
    
    .navbar {
        background: rgba(26, 26, 46, 0.95);
    }
    
    .nav-link {
        color: var(--dark);
    }
    
    .stream-container,
    .rsvp-form,
    .rsvp-confirmed,
    .modal-content,
    .chat-section,
    .gallery-item,
    .photo-item {
        background: var(--gray-100);
        border-color: var(--gray-200);
    }
    
    .stream-info,
    .rsvp-details,
    .note-box,
    .stat-box,
    .gift-option {
        background: var(--gray-200);
    }
    
    .form-control,
    textarea,
    select,
    input {
        background: var(--gray-200);
        border-color: var(--gray-300);
        color: var(--dark);
    }
}

/* === Accessibility: Large Text === */
@media (prefers-reduced-data: no-preference) {
    @media (min-width: 768px) {
        .couple-name {
            font-size: 4rem;
        }
        
        .hero-title {
            font-size: 2rem;
        }
    }
}

/* === Safe Area Insets (Notch Support) === */
@supports (padding: max(0px)) {
    body {
        padding-left: min(0vmin, env(safe-area-inset-left));
        padding-right: min(0vmin, env(safe-area-inset-right));
        padding-top: min(0vmin, env(safe-area-inset-top));
        padding-bottom: min(0vmin, env(safe-area-inset-bottom));
    }
    
    .navbar {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
        padding-top: max(10px, env(safe-area-inset-top));
    }
    
    .hero {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-top: max(140px, calc(140px + env(safe-area-inset-top)));
    }
    
    .footer {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* === Container Queries (Future Support) === */
@container (max-width: 400px) {
    .countdown-container {
        flex-wrap: wrap;
    }
    
    .countdown-box {
        min-width: 70px;
    }
}

/* === Performance Optimizations for Mobile === */
@media (max-width: 768px) {
    /* Reduce complex animations */
    .animated-bg {
        background-size: 200% 200%;
        animation-duration: 20s;
    }
    
    /* Limit floating elements on mobile */
    .floating-hearts i:nth-child(n+8),
    .floating-flowers i:nth-child(n+6) {
        display: none;
    }
    
    /* Optimize images */
    img {
        loading: lazy;
    }
    
    /* Reduce blur effects on low-end devices */
    @media (max-resolution: 1.5dppx) {
        .navbar,
        .hero-badge,
        .countdown-box,
        .wedding-date,
        .wedding-location {
            backdrop-filter: none;
        }
    }
}

/* === Orientation Specific Styles === */
@media screen and (orientation: portrait) {
    .hero {
        min-height: 100vh;
    }
    
    .couple-name {
        flex-direction: column;
    }
    
    .heart-icon {
        transform: rotate(90deg);
    }
}

@media screen and (orientation: landscape) and (max-height: 500px) {
    .hero {
        min-height: auto;
        padding: 100px 20px 50px;
    }
    
    .couple-name {
        font-size: 2.5rem;
    }
    
    .nav-menu {
        max-height: 250px;
    }
}

/* === Utility Classes for Responsive Design === */
/* Hide/Show based on screen size */
.hide-on-mobile {
    display: block;
}

.show-on-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-on-mobile {
        display: none;
    }
    
    .show-on-mobile {
        display: block;
    }
}

/* Responsive text alignment */
.text-center-mobile {
    text-align: center;
}

@media (min-width: 769px) {
    .text-center-mobile {
        text-align: left;
    }
}

/* Responsive spacing */
.mobile-mt-1 { margin-top: 0.25rem; }
.mobile-mt-2 { margin-top: 0.5rem; }
.mobile-mt-3 { margin-top: 1rem; }
.mobile-mt-4 { margin-top: 1.5rem; }
.mobile-mt-5 { margin-top: 3rem; }

@media (min-width: 769px) {
    .mobile-mt-1,
    .mobile-mt-2,
    .mobile-mt-3,
    .mobile-mt-4,
    .mobile-mt-5 {
        margin-top: 0;
    }
}

/* Responsive grid */
.grid-mobile-1 {
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 769px) {
    .grid-mobile-1 {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Responsive flex */
.flex-column-mobile {
    flex-direction: column;
}

@media (min-width: 769px) {
    .flex-column-mobile {
        flex-direction: row;
    }
}

/* === Debugging Helper (Remove in Production) === */
/* 
.responsive-debug::after {
    content: 'Mobile (<576px)';
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: #ff6b8b;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 9999;
}

@media (min-width: 576px) {
    .responsive-debug::after {
        content: 'Small (576px-768px)';
        background: #06d6a0;
    }
}

@media (min-width: 768px) {
    .responsive-debug::after {
        content: 'Tablet (768px-1024px)';
        background: #3b82f6;
    }
}

@media (min-width: 1024px) {
    .responsive-debug::after {
        content: 'Desktop (1024px-1200px)';
        background: #8b5cf6;
    }
}

@media (min-width: 1200px) {
    .responsive-debug::after {
        content: 'Large Desktop (1200px+)';
        background: #f59e0b;
    }
}
*/

/* === Print-only Content === */
.print-only {
    display: none;
}

@media print {
    .print-only {
        display: block;
    }
    
    .no-print {
        display: none;
    }
}

/* === Loading States for Slow Connections === */
@media (prefers-reduced-data: reduce) {
    .animated-bg,
    .floating-hearts,
    .floating-flowers,
    .hero::before {
        display: none;
    }
    
    img {
        loading: eager;
    }
}

/* === Performance: Will-change optimizations === */
@media (prefers-reduced-motion: no-preference) {
    .nav-menu,
    .modal-content,
    .notification {
        will-change: transform, opacity;
    }
}

/* === Final Mobile Optimization Overrides === */
@media (max-width: 768px) {
    /* Disable horizontal scroll */
    html, body {
        overflow-x: hidden;
        position: relative;
        width: 100%;
    }
    
    /* Improve tap highlight */
    a, button, .nav-link, .btn {
        -webkit-tap-highlight-color: rgba(255, 107, 139, 0.3);
    }
    
    /* Prevent text size adjustment on orientation change */
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}