/* Wedding Photo App - Custom Styles */

/* Color Variables */
:root {
    --gold: #D4AF37;
    --dark-gold: #B8941F;
    --wedding-primary: #8B4513;
    --wedding-secondary: #CD853F;
    --wedding-accent: #F5DEB3;
    --wedding-dark: #2C1810;
    --wedding-light: #FAF7F0;
}

/* Base Styles */
body {
    font-family: 'Poppins', sans-serif;
    background: 
        linear-gradient(135deg, rgba(250, 247, 240, 0.8) 0%, rgba(255, 248, 220, 0.8) 100%),
        url('../background.jpg') center center/cover no-repeat fixed;
    color: #333;
    line-height: 1.6;
}

/* Text Colors */
.text-gold {
    color: var(--gold) !important;
}

.bg-gold {
    background-color: var(--gold) !important;
}

/* Typography */
.couple-names {
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    color: var(--gold);
}

.couple-names-large {
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    font-size: 3.5rem;
    color: var(--gold);
}

.brand-text {
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    font-size: 1.8rem;
}

.hero-title {
    margin-bottom: 2rem;
}

.hero-subtitle {
    font-size: 2rem;
    color: var(--wedding-primary);
    font-weight: 300;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    color: #666;
}

/* Navigation */
.wedding-nav {
    background: linear-gradient(135deg, var(--wedding-primary) 0%, var(--wedding-secondary) 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Buttons */
.btn-wedding {
    background: linear-gradient(135deg, var(--wedding-primary) 0%, var(--wedding-secondary) 100%);
    border: none;
    color: white;
    font-weight: 500;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.btn-wedding:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
    color: white;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, var(--dark-gold) 100%);
    border: none;
    color: white;
    font-weight: 500;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    color: white;
}

.btn-outline-gold {
    border: 2px solid var(--gold);
    color: var(--gold);
    background: transparent;
    font-weight: 500;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.btn-outline-gold:hover {
    background: var(--gold);
    color: white;
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.hero-section {
    padding: 3rem 0 4rem;
}

/* Camera Section */
.camera-section {
    max-width: 400px;
    margin: 0 auto;
}

.camera-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    aspect-ratio: 1/1;
    max-width: 100%;
    margin: 0 auto;
    min-height: 300px;
}

.camera-video,
.camera-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

#video {
    transform: scaleX(-1); /* Mirror effect for selfie view */
}

#canvas {
    transform: none; /* Don't mirror the captured photo */
    object-fit: cover; /* Match the video preview cropping */
    background: #000;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.face-guide {
    text-align: center;
}

.face-circle {
    width: 200px;
    height: 200px;
    border: 3px solid var(--gold);
    border-radius: 50%;
    margin: 0 auto 1rem;
    opacity: 0.8;
    animation: pulse 2s infinite;
}

.face-guide-text {
    color: white;
    background: rgba(0,0,0,0.7);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

.camera-controls {
    margin-top: 2rem;
}

/* Upload Section */
.upload-section .divider {
    position: relative;
    text-align: center;
    margin: 2rem 0;
}

.upload-section .divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
    z-index: 1;
}

.divider-text {
    background: var(--wedding-light);
    padding: 0 1rem;
    color: #999;
    position: relative;
    z-index: 2;
}

/* Instructions */
.instructions {
    background: rgba(255,255,255,0.8);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.instruction-item {
    padding: 1rem;
    border-radius: 15px;
    background: rgba(255,255,255,0.5);
    height: 100%;
    transition: transform 0.3s ease;
}

.instruction-item:hover {
    transform: translateY(-5px);
}

/* Status Section */
.status-section {
    padding: 2rem 0;
}

.status-card {
    background: white;
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid var(--wedding-accent);
}

.status-state {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.status-icon {
    margin-bottom: 1rem;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--wedding-accent);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
}

.timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
    text-align: right;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-right: 3rem;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: 3rem;
}

.timeline-marker {
    width: 40px;
    height: 40px;
    background: var(--wedding-accent);
    border: 3px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.timeline-item.completed .timeline-marker {
    background: var(--gold);
    color: white;
}

.timeline-content h6 {
    color: var(--wedding-primary);
    font-weight: 600;
}

/* Photos Section */
.photos-section {
    padding: 2rem 0;
}

.photo-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.photo-grid img:hover {
    transform: scale(1.05);
}

.carousel-item img {
    max-height: 70vh;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 10px;
}

/* About Section */
.about-section {
    padding: 2rem 0;
}

.info-card,
.step-card {
    background: rgba(255,255,255,0.8);
    border-radius: 15px;
    padding: 2rem 1rem;
    text-align: center;
    height: 100%;
    transition: transform 0.3s ease;
}

.info-card:hover,
.step-card:hover {
    transform: translateY(-5px);
}

.step-number {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--gold);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.step-card {
    position: relative;
    margin-top: 20px;
}

.feature-item,
.tip-card {
    background: rgba(255,255,255,0.6);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    transition: background 0.3s ease;
}

.feature-item:hover,
.tip-card:hover {
    background: rgba(255,255,255,0.9);
}

.cta-card {
    background: white;
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Modals */
.wedding-modal .modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.loading-modal .modal-content {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
}

.photo-modal .modal-content {
    background: #000;
    color: white;
}

.photo-modal img {
    max-height: 80vh;
    border-radius: 10px;
}

/* Footer */
.wedding-footer {
    background: linear-gradient(135deg, var(--wedding-dark) 0%, var(--wedding-primary) 100%);
    color: white;
    margin-top: 4rem;
}

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

.footer-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .couple-names-large {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .camera-container {
        max-width: 90vw;
    }
    
    .face-circle {
        width: 150px;
        height: 150px;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        flex-direction: row !important;
        text-align: left !important;
    }
    
    .timeline-item .timeline-content {
        margin-left: 3rem !important;
        margin-right: 0 !important;
    }
    
    .timeline-marker {
        position: absolute;
        left: 0;
    }
}

@media (max-width: 576px) {
    .btn-wedding,
    .btn-gold,
    .btn-outline-gold {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .instructions,
    .status-card,
    .cta-card {
        margin: 0 1rem;
        padding: 1.5rem 1rem;
    }
}

/* Loading Animations */
.loading-spinner {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Utility Classes */
.section-title {
    color: var(--wedding-primary);
    font-weight: 600;
}

.bg-wedding-gradient {
    background: linear-gradient(135deg, var(--wedding-primary) 0%, var(--wedding-secondary) 100%);
}

/* Toast Styles */
.toast-container {
    z-index: 1060; /* Higher than Bootstrap modal backdrop */
    position: fixed !important;
    bottom: 1rem !important;
    right: 1rem !important;
    max-width: 300px;
    /* iOS-specific positioning fixes */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

.toast {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 0.5rem;
    /* Ensure visibility on iOS */
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.toast-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
}

.toast-body {
    padding: 0.75rem;
    font-size: 0.9rem;
}

/* iOS-specific fixes for modals */
.modal {
    /* Fix iOS modal positioning */
    -webkit-overflow-scrolling: touch;
}

.modal-dialog {
    /* Ensure modal is properly positioned on iOS */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

.modal-backdrop {
    /* Ensure backdrop works on iOS */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* iOS Safari/Chrome specific viewport fixes */
@supports (-webkit-touch-callout: none) {
    .toast-container {
        /* Use viewport units for iOS */
        bottom: max(1rem, env(safe-area-inset-bottom)) !important;
        right: max(1rem, env(safe-area-inset-right)) !important;
    }
    
    body {
        /* Fix iOS viewport issues */
        -webkit-text-size-adjust: 100%;
    }
}

/* Instructions Page Styles */
.instructions-section {
    padding: 2rem 0 4rem;
}

.instructions-header {
    margin-bottom: 4rem;
}

.instructions-title {
    margin-bottom: 1.5rem;
}

.step-item {
    margin-bottom: 4rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.step-number {
    background: linear-gradient(135deg, var(--gold) 0%, var(--dark-gold) 100%);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.3rem;
    margin-right: 1rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    flex-shrink: 0;
}

.step-title {
    color: var(--wedding-primary);
    font-weight: 600;
    font-size: 1.4rem;
    margin: 0;
}

.step-description {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.7;
    margin: 0;
}

.step-image {
    text-align: center;
}

.step-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
}

.step-image img:hover {
    transform: scale(1.02);
}

.quick-tips {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 3rem 2rem;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.instructions-cta {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.instructions-link-section {
    border-top: 1px solid rgba(212, 175, 55, 0.3);
}

/* Responsive adjustments for instructions */
@media (max-width: 992px) {
    .step-item {
        padding: 1.5rem;
        margin-bottom: 3rem;
    }
    
    .step-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .step-number {
        margin-right: 0;
        margin-bottom: 1.5rem;
    }
    
    .step-title {
        font-size: 1.2rem;
        margin-top: 1rem;
    }
    
    .step-description {
        font-size: 1rem;
    }
    
    .step-image img {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .instructions-section {
        padding: 1rem 0 3rem;
    }
    
    .step-item {
        margin: 0 1rem 2rem;
        padding: 1rem;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .step-title {
        font-size: 1.1rem;
    }
    
    .step-description {
        font-size: 0.95rem;
    }
    
    .quick-tips,
    .instructions-cta {
        margin: 0 1rem;
        padding: 2rem 1.5rem;
    }
    
    .instructions-header {
        margin-bottom: 2rem;
    }
    
    .couple-names-large {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .step-item {
        margin: 0 0.5rem 1.5rem;
        padding: 1rem;
    }
    
    .step-image img {
        max-height: 250px;
    }
    
    .quick-tips,
    .instructions-cta {
        margin: 0 0.5rem;
        padding: 1.5rem 1rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--wedding-light);
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gold);
}
