/* ============================================
   TO'Y TAKLIFNOMASI - Klassik An'anaviy Dizayn
   Islomiy naqshlar bilan
   ============================================ */

/* === CSS Variables === */
:root {
    --gold-light: #f0d68a;
    --gold: #c9a84c;
    --gold-dark: #a07c2a;
    --gold-deep: #7a5c1e;
    --cream: #fdf8ef;
    --cream-dark: #f5ead6;
    --burgundy: #6b1d3a;
    --burgundy-light: #8e2c50;
    --dark-green: #1a3c34;
    --dark-green-light: #264d43;
    --text-dark: #2c1810;
    --text-medium: #5a4030;
    --text-light: #8a7060;
    --shadow-gold: rgba(201, 168, 76, 0.3);
    --shadow-dark: rgba(0, 0, 0, 0.15);
    --bg-pattern: #f9f0e0;
}

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    background-color: var(--bg-pattern);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* Subtle background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(201, 168, 76, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(107, 29, 58, 0.05) 0%, transparent 50%),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 30px,
            rgba(201, 168, 76, 0.02) 30px,
            rgba(201, 168, 76, 0.02) 31px
        );
    pointer-events: none;
    z-index: 0;
}

/* === Floating Particles === */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: floatParticle 8s infinite ease-in-out;
}

@keyframes floatParticle {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    20% {
        opacity: 0.6;
    }
    80% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: translateY(-20vh) scale(1);
    }
}

/* === Invitation Wrapper === */
.invitation-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* === Ornaments === */
.ornament-top,
.ornament-bottom {
    text-align: center;
    padding: 10px 0;
}

.ornament-svg {
    width: 300px;
    max-width: 80%;
    height: auto;
    color: var(--gold);
    filter: drop-shadow(0 2px 4px var(--shadow-gold));
}

/* === Main Card === */
.invitation-card {
    background: linear-gradient(
        135deg,
        var(--cream) 0%,
        #fff 30%,
        var(--cream) 50%,
        #fff 70%,
        var(--cream) 100%
    );
    border: 2px solid var(--gold);
    border-radius: 20px;
    padding: 50px 40px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 0 1px var(--gold-light),
        0 0 0 4px var(--cream-dark),
        0 0 0 5px var(--gold),
        0 20px 60px var(--shadow-dark),
        0 0 80px rgba(201, 168, 76, 0.1);
}

/* Inner glow border effect */
.invitation-card::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 14px;
    pointer-events: none;
}

/* Corner decorations */
.invitation-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at top left, rgba(201, 168, 76, 0.08) 0%, transparent 40%),
        radial-gradient(ellipse at bottom right, rgba(201, 168, 76, 0.08) 0%, transparent 40%);
    pointer-events: none;
    border-radius: 18px;
}

/* === Bismillah Section === */
.bismillah-section {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.bismillah-ornament {
    color: var(--gold);
    font-size: 1.2rem;
    margin: 8px 0;
    letter-spacing: 4px;
}

.bismillah-text {
    font-family: 'Amiri', 'Noto Nastaliq Urdu', serif;
    font-size: 2rem;
    color: var(--gold-dark);
    direction: rtl;
    line-height: 2;
    text-shadow: 0 1px 2px rgba(201, 168, 76, 0.2);
    letter-spacing: 2px;
}

.bismillah-translation {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    color: var(--text-medium);
    font-style: italic;
    margin-top: 8px;
    letter-spacing: 1px;
}

/* === Divider === */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 25px 0;
    position: relative;
    z-index: 1;
}

.divider-line {
    flex: 1;
    max-width: 80px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--gold),
        transparent
    );
}

.divider-star {
    color: var(--gold);
    font-size: 1.4rem;
    animation: rotateStar 10s linear infinite;
}

.divider-ornament {
    color: var(--gold-light);
    font-size: 0.9rem;
}

@keyframes rotateStar {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* === Greeting Section === */
.greeting-section {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.greeting-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: var(--text-dark);
    font-weight: 500;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.greeting-subtext {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem;
    color: var(--text-medium);
    line-height: 1.8;
    letter-spacing: 0.5px;
}

/* === Names Section === */
.names-section {
    position: relative;
    padding: 40px 30px;
    margin: 20px 0;
    z-index: 1;
}

.corner-ornament {
    position: absolute;
    width: 50px;
    height: 50px;
    color: var(--gold);
    opacity: 0.7;
}

.corner-ornament.top-left { top: 0; left: 0; }
.corner-ornament.top-right { top: 0; right: 0; }
.corner-ornament.bottom-left { bottom: 0; left: 0; }
.corner-ornament.bottom-right { bottom: 0; right: 0; }

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

.name-label {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 4px;
}

.groom-name,
.bride-name {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--gold-dark);
    text-shadow: 0 2px 4px rgba(201, 168, 76, 0.2);
    line-height: 1.2;
    margin: 5px 0;
}

.groom-name {
    font-size: 3.5rem;
    animation: shimmerName 3s ease-in-out infinite alternate;
}

.bride-name {
    font-size: 3.5rem;
    animation: shimmerName 3s ease-in-out infinite alternate;
    animation-delay: 1.5s;
}

@keyframes shimmerName {
    0% {
        text-shadow: 0 2px 4px rgba(201, 168, 76, 0.2);
    }
    100% {
        text-shadow: 
            0 2px 4px rgba(201, 168, 76, 0.2),
            0 0 20px rgba(201, 168, 76, 0.15),
            0 0 40px rgba(201, 168, 76, 0.05);
    }
}

.and-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.and-line {
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.and-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-style: italic;
    color: var(--gold);
    font-weight: 300;
}

/* === Details Section === */
.details-section {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.detail-card {
    flex: 1;
    min-width: 120px;
    max-width: 160px;
    text-align: center;
    padding: 25px 15px;
    background: linear-gradient(145deg, rgba(253, 248, 239, 0.8), rgba(255, 255, 255, 0.9));
    border: 1px solid rgba(201, 168, 76, 0.25);
    border-radius: 16px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.detail-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.08), transparent);
    transition: left 0.6s ease;
}

.detail-card:hover::before {
    left: 100%;
}

.detail-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-gold);
    border-color: var(--gold);
}

.detail-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 12px;
    color: var(--gold);
}

.detail-icon svg {
    width: 100%;
    height: 100%;
}

.detail-label {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 6px;
}

.detail-value {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold-dark);
    line-height: 1.2;
}

.detail-sub {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    color: var(--text-medium);
    margin-top: 4px;
}

/* === Location Section === */
.location-section {
    margin: 30px 0;
    position: relative;
    z-index: 1;
}

.location-card {
    text-align: center;
    padding: 30px 25px;
    background: linear-gradient(135deg, rgba(26, 60, 52, 0.03), rgba(107, 29, 58, 0.03));
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.location-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(201, 168, 76, 0.03) 60deg,
        transparent 120deg,
        rgba(201, 168, 76, 0.03) 180deg,
        transparent 240deg,
        rgba(201, 168, 76, 0.03) 300deg,
        transparent 360deg
    );
    animation: rotatePattern 20s linear infinite;
}

@keyframes rotatePattern {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.location-icon-large {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    color: var(--burgundy);
    position: relative;
    animation: bouncePin 2s ease-in-out infinite;
}

.location-icon-large svg {
    width: 100%;
    height: 100%;
}

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

.location-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    position: relative;
}

.location-address {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--text-medium);
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    position: relative;
}

.map-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--dark-green), var(--dark-green-light));
    color: var(--gold-light);
    text-decoration: none;
    border-radius: 50px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(26, 60, 52, 0.3);
}

.map-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(240, 214, 138, 0.2), transparent);
    transition: left 0.5s ease;
}

.map-button:hover::before {
    left: 100%;
}

.map-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(26, 60, 52, 0.4);
    background: linear-gradient(135deg, var(--dark-green-light), var(--dark-green));
}

.map-icon {
    width: 20px;
    height: 20px;
}

.arrow-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.map-button:hover .arrow-icon {
    transform: translateX(4px);
}

/* === Countdown Section === */
.countdown-section {
    text-align: center;
    margin: 35px 0 25px;
    position: relative;
    z-index: 1;
}

.countdown-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-medium);
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
    padding: 15px 10px;
    background: linear-gradient(145deg, var(--cream), #fff);
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow-gold);
}

.countdown-number {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--burgundy);
    line-height: 1;
}

.countdown-label {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 6px;
}

.countdown-separator {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--gold);
    font-weight: 300;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* === Closing Section === */
.closing-section {
    text-align: center;
    margin-top: 25px;
    position: relative;
    z-index: 1;
}

.closing-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.closing-dua {
    font-family: 'Amiri', 'Noto Nastaliq Urdu', serif;
    font-size: 1.3rem;
    color: var(--gold-dark);
    direction: rtl;
    line-height: 2.2;
    margin-bottom: 10px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.05), transparent, rgba(201, 168, 76, 0.05));
    border-radius: 10px;
}

.closing-translation {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    color: var(--text-medium);
    font-style: italic;
    line-height: 1.8;
    letter-spacing: 0.5px;
}

/* === Islamic Pattern === */
.islamic-pattern {
    text-align: center;
    margin-top: 30px;
    position: relative;
    z-index: 1;
}

.pattern-row {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.pattern-item {
    color: var(--gold);
    font-size: 1rem;
    animation: pulsePattern 3s ease-in-out infinite;
}

.pattern-item:nth-child(2) { animation-delay: 0.3s; }
.pattern-item:nth-child(3) { animation-delay: 0.6s; }
.pattern-item:nth-child(4) { animation-delay: 0.9s; }
.pattern-item:nth-child(5) { animation-delay: 1.2s; }

@keyframes pulsePattern {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

/* === Audio Toggle === */
.audio-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: linear-gradient(135deg, var(--cream), #fff);
    color: var(--gold-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--shadow-gold);
    transition: all 0.3s ease;
    z-index: 100;
    padding: 12px;
}

.audio-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow-gold);
}

.audio-toggle svg {
    width: 24px;
    height: 24px;
}

/* === Fade In Animation === */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Responsive Design === */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .invitation-card {
        padding: 35px 20px;
        border-radius: 16px;
    }

    .invitation-card::before {
        top: 8px;
        left: 8px;
        right: 8px;
        bottom: 8px;
        border-radius: 10px;
    }

    .bismillah-text {
        font-size: 1.5rem;
    }

    .groom-name,
    .bride-name {
        font-size: 2.5rem;
    }

    .details-section {
        gap: 12px;
    }

    .detail-card {
        min-width: 90px;
        padding: 18px 10px;
    }

    .detail-value {
        font-size: 1.2rem;
    }

    .countdown-item {
        min-width: 60px;
        padding: 10px 8px;
    }

    .countdown-number {
        font-size: 1.6rem;
    }

    .map-button {
        padding: 12px 22px;
        font-size: 0.9rem;
    }

    .corner-ornament {
        width: 35px;
        height: 35px;
    }

    .names-section {
        padding: 30px 15px;
    }

    .closing-dua {
        font-size: 1.1rem;
        padding: 10px;
    }
}

@media (max-width: 360px) {
    .groom-name,
    .bride-name {
        font-size: 2rem;
    }

    .detail-card {
        min-width: 80px;
    }

    .countdown-timer {
        gap: 5px;
    }

    .countdown-item {
        min-width: 55px;
    }
}

/* === Mobile Performance Optimizations === */
@media (max-width: 768px) {
    /* GPU acceleration for smooth scrolling */
    .invitation-card,
    .names-section,
    .details-section,
    .location-card,
    .countdown-section {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    /* Reduce heavy animations on mobile */
    .location-card::before {
        animation-duration: 40s;
    }

    .divider-star {
        animation-duration: 20s;
    }

    /* Reduce particle count visibility on mobile */
    .particle:nth-child(n+15) {
        display: none;
    }

    /* Fix iOS Safari 100vh issue */
    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }

    html {
        height: -webkit-fill-available;
    }

    /* Smooth scrolling on iOS */
    .invitation-wrapper {
        -webkit-overflow-scrolling: touch;
    }

    /* Remove hover effects on touch devices */
    .detail-card:hover {
        transform: none;
        box-shadow: none;
    }

    .map-button:hover {
        transform: none;
    }

    /* Tap highlight fix for iOS */
    button, a {
        -webkit-tap-highlight-color: transparent;
    }

    /* Fix touch delays */
    * {
        touch-action: manipulation;
    }
}

/* === Very small screens (old phones) === */
@media (max-width: 320px) {
    .invitation-card {
        padding: 25px 15px;
    }

    .bismillah-text {
        font-size: 1.3rem;
    }

    .greeting-text {
        font-size: 1.1rem;
    }

    .groom-name,
    .bride-name {
        font-size: 1.8rem;
    }

    .detail-card {
        min-width: 70px;
        padding: 15px 8px;
    }

    .countdown-item {
        min-width: 50px;
        padding: 8px 5px;
    }

    .countdown-number {
        font-size: 1.4rem;
    }

    .location-title {
        font-size: 1.1rem;
    }

    .map-button {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
}

/* === Reduced Motion (battery saver / accessibility) === */
@media (prefers-reduced-motion: reduce) {
    .particle {
        display: none !important;
    }

    .divider-star {
        animation: none;
    }

    .countdown-separator {
        animation: none;
    }

    .location-icon-large {
        animation: none;
    }

    .location-card::before {
        animation: none;
    }

    .pattern-item {
        animation: none;
        opacity: 0.8;
    }

    .groom-name,
    .bride-name {
        animation: none;
    }

    .fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* === Print Styles === */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .particles {
        display: none;
    }

    .invitation-card {
        box-shadow: none;
        border: 2px solid var(--gold);
    }

    .fade-in {
        opacity: 1;
        transform: none;
    }
}
