/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #e2e8f0;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Navigation Styles - Optimized */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    transition: background 0.3s ease;
    box-shadow: 0 2px 20px rgba(0, 212, 255, 0.1);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #983168;
    font-family: cursive;
    text-shadow: 0 0 10px rgba(221, 198, 214, 0.5);
}

.nav-logo i {
    color: #a33170;
    animation: heartbeat 2s infinite;
    filter: drop-shadow(0 0 5px rgba(242, 242, 242, 0.6));
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #a94788;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 25px;
}

.nav-link:hover,
.nav-link.active {
    color: #7c0f5d;
    background: rgba(0, 212, 255, 0.1);
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #9b3672, #8b5cf6);
    transition: width 0.3s ease;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #00d4ff;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.3);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Music Player Styles - Performance Optimized */
.music-player {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(145deg, #630934, #16213e);
    border-radius: 20px;
    padding: 1rem;
    box-shadow: 0 8px 32px rgba(232, 226, 226, 0.4), 0 0 20px rgba(0, 212, 255, 0.1);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 320px;
    transition: transform 0.3s ease;
    border: 1px solid rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(10px);
}

.player-controls {
    display: flex;
    gap: 0.5rem;
}

.player-controls button {
    background: rgba(99, 31, 85, 0.2);
    border: none;
    font-size: 1.2rem;
    color: #ffffff;
    cursor: pointer;
    padding: 0.7rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    border: 1px solid rgba(160, 24, 106, 0.3);
}

.player-controls button:hover {
    background: rgba(161, 12, 89, 0.3);
    color: #fff;
    box-shadow: 0 0 15px rgba(220, 223, 224, 0.4);
    transform: scale(1.05);
}

.player-info {
    flex: 1;
}

#songTitle {
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
    color: #e2e8f0;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(227, 143, 183, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #5f0d40, #8b5cf6);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-control i {
    color: #f5f3f4;
}

#volumeSlider {
    width: 60px;
    accent-color: #fff1f9;
}

/* Main Content Styles */
.main-content {
    margin-top: 80px;
}

.section {
    width: 100%;
    padding: 5rem 2rem;
    position: relative;
    scroll-margin-top: 80px;
}

.section:nth-child(even) {
    background: rgba(22, 33, 62, 0.3);
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 3rem;
    color: #8c407a;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(139, 34, 86, 0.5);
    font-family: cursive;
    background: linear-gradient(45deg, #44102a, #bf215b, #ff00cc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-header p {
    font-size: 1.3rem;
    color: #94a3b8;
    max-width: 600px;
    margin: 0 auto;
}

/* HOME SECTION WITH SIDE IMAGES - NEW */
#home {
    background: url('f4.png') center/cover;
    position: relative;
    overflow: hidden;
}

#home::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.8) 0%, rgba(26, 26, 46, 0.6) 50%, rgba(22, 33, 62, 0.8) 100%);
    z-index: 1;
}

.hero {
    text-align: center;
    position: relative;
    padding: 3rem 0;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
}

.hero-title {
    font-size: 4rem;
    color: #00d4ff;
    margin-bottom: 2rem;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
    font-family: cursive;
    line-height: 1.2;
    background: linear-gradient(45deg, #761e50, #dc92e8, #4c0631);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: glow 3s ease-in-out infinite alternate;
}

.friendship-counter {
    background: linear-gradient(145deg, rgba(52, 21, 39, 0.2), rgba(22, 33, 62, 0.8));
    border-radius: 25px;
    padding: 3rem;
    margin: 3rem auto;
    max-width: 400px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(10px);
}

.counter-card {
    margin-bottom: 1.5rem;
}

.counter-number {
    font-size: 4.5rem;
    font-weight: bold;
    color: #f1e2e5;
    line-height: 1;
    font-family: fantasy;
    text-shadow: 0 0 20px rgba(246, 239, 235, 0.6);
    background: linear-gradient(45deg, #640d3b, #d81f85);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.counter-label {
    font-size: 1.3rem;
    color: #e9a2ca;
    margin-top: 0.5rem;
}

.counter-details {
    color: #64748b;
    font-style: italic;
    font-size: 1.1rem;
}

/* HOME SIDE IMAGES - NEW FEATURE */
.home-side-images {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.side-images-left,
.side-images-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.side-images-left {
    left: 2rem;
}

.side-images-right {
    right: 2rem;
}

.side-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(196, 209, 211, 0.5);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 212, 255, 0.3);
    opacity: 0.8;
    transition: all 0.3s ease;
    animation: floatSideImage 6s ease-in-out infinite;
}

.side-image:nth-child(1) {
    animation-delay: 0s;
}

.side-image:nth-child(2) {
    animation-delay: 1s;
}

.side-image:nth-child(3) {
    animation-delay: 2s;
}

.side-image:nth-child(4) {
    animation-delay: 3s;
}

.side-image:hover {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 212, 255, 0.6);
}

/* Floating Hearts Animation - Optimized */
.floating-hearts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 2;
}

.heart {
    position: absolute;
    color: rgba(95, 5, 44, 0.6);
    font-size: 2rem;
    animation: floatHeart 12s infinite linear;
    will-change: transform;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.4));
}

.heart::before {
    content: '♥';
}

.heart:nth-child(1) {
    left: 15%;
    animation-delay: 0s;
}

.heart:nth-child(2) {
    left: 35%;
    animation-delay: 2.4s;
}

.heart:nth-child(3) {
    left: 55%;
    animation-delay: 4.8s;
}

.heart:nth-child(4) {
    left: 75%;
    animation-delay: 7.2s;
}

.heart:nth-child(5) {
    left: 85%;
    animation-delay: 9.6s;
}

/* PHOTOS SECTION - HIGHLY OPTIMIZED FOR PERFORMANCE */
#photos {
    background: rgba(22, 33, 62, 0.3);
}

.photo-gallery {
    margin-top: 2rem;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 0;
}

.photo-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.8) 0%, rgba(26, 26, 46, 0.6) 50%, rgba(22, 33, 62, 0.8) 100%);
    border: 1px solid rgba(188, 210, 215, 0.9);
    /* Performance optimizations */
    will-change: transform;
    contain: layout style paint;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 212, 255, 0.1);
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 25px rgba(0, 212, 255, 0.2);
}

.photo-item img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    /* Remove transition for better performance */
    transition: none;
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(10, 10, 10, 0.95));
    color: white;
    padding: 2rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.2s ease;
    will-change: transform;
}

.photo-item:hover .photo-overlay {
    transform: translateY(0);
}

.photo-overlay h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #630a31;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.95);
}

.photo-overlay p {
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.4;
    color: #94a3b8;
}

/* PHOTO MODAL - PERFORMANCE OPTIMIZED */
.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.95);
    z-index: 2000;
    will-change: opacity;
    contain: layout style paint;
    backdrop-filter: blur(10px);
}

.photo-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: linear-gradient(145deg, rgba(88, 46, 140, 0), rgba(53, 18, 53, 0.9));
    border-radius: 15px;
    overflow: hidden;
    will-change: transform;
    contain: layout style paint;
    margin-left: 75px;
    margin-top: 50px;
    border: 1px solid rgba(234, 240, 241, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 212, 255, 0.2);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.8rem;
    color: #640b38;
    cursor: pointer;
    z-index: 2001;
    background: rgba(10, 10, 10, 0.8);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 1px solid rgba(208, 215, 216, 0.3);
    outline: none;
}

.close-modal:hover {
    background: rgba(87, 7, 52, 0.2);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

#modalImage {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.modal-info {
    padding: 1.5rem;
    text-align: center;
    background: linear-gradient(145deg, rgba(43, 5, 26, 0.8), rgba(22, 33, 62, 0.8));
}

#modalTitle {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #c8dee2;
    text-shadow: 0 0 10px rgba(200, 129, 209, 0.5);
}

#modalDescription {
    font-size: 1rem;
    color: #94a3b8;
    line-height: 1.6;
}

/* Book Styles - Optimized */
.book-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.book {
    background-image: url('f7.png');
    border-radius: 15px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 0 25px rgba(0, 212, 255, 0.1);
    position: relative;
    min-height: 450px;
    border: 1px solid rgba(232, 239, 240, 0.3);
}

.book-page {
    display: none;
    background: linear-gradient(145deg, rgba(77, 9, 58, 0.2), rgba(159, 19, 131, 0.213));
    border-radius: 10px;
    padding: 3.5rem;
    margin: 1rem;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
    position: relative;
    min-height: 350px;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.book-page.active {
    display: block;
}

.page-content {
    text-align: left;
}

.page-content h3 {
    color: #f7a9d6;
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    font-family: cursive;
    text-shadow: 0 0 15px rgba(226, 235, 236, 0.5);
}

.page-content p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #e2e8f0;
    text-align: justify;
    font-family: fantasy;
    font-size: 1.4rem;
}

.page-decoration {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    font-size: 2.5rem;
    color: #c61964;
    opacity: 0.6;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.4));
}

.book-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
    gap: 2rem;
}

.page-btn {
    background: linear-gradient(145deg, #360924, #931486);
    color: #fff;
    border: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.page-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(198, 206, 208, 0.4);
}

.page-btn:disabled {
    background: linear-gradient(145deg, #360924, #931486);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    border: 1px solid #4b5563;
}

.page-indicator {
    color: #eaeff0;
    font-weight: 600;
    font-size: 1.1rem;
    background: rgba(0, 212, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

/* Letter Styles - Optimized */
.letter-container {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.letter-envelope {
    background-image: url('z.png');
    background-size: cover;
    width: 350px;
    height: 220px;
    margin: 0 auto 3rem;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.letter-envelope:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 212, 255, 0.2);
}

.envelope-front {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.envelope-seal {
    background: linear-gradient(145deg, #f1176a, #862039);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #e3e3ef;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.envelope-front p {
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(218, 229, 232, 0.3);
    color: #e4eaeb;
    font-family: cursive;
}

.letter-paper {
    display: none;
    background: linear-gradient(145deg, rgba(30, 30, 63, 0.95), rgba(22, 33, 62, 0.95));
    border-radius: 15px;
    padding: 3rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(10px);
}

.letter-paper.active {
    display: block;
    background-image: url('m.png');
}

.letter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(251, 251, 251, 0.3);
}

.letter-header h3 {
    color: #a41a4f;
    font-size: 1.8rem;
    font-family: cursive;
    text-shadow: 0 0 10px rgba(77, 13, 41, 0.5);
}

.letter-date {
    color: #94a3b8;
    font-style: italic;
    font-size: 1rem;
}

#letterContent {
    width: 100%;
    border: none;
    background: transparent;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    line-height: 1.8;
    resize: vertical;
    outline: none;
    color: #e2e8f0;
    min-height: 300px;
}

.letter-footer {
    margin-top: 2.5rem;
    text-align: right;
}

.letter-footer p {
    font-style: italic;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.signature-line {
    width: 250px;
    height: 3px;
    background: linear-gradient(145deg, #360924, #931486);
    margin: 1rem 0 0 auto;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.letter-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 3rem;
}

.letter-btn {
    background: linear-gradient(145deg, #360924, #931486);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.letter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.letter-btn.secondary {
    background: linear-gradient(145deg, #6b7280, #4b5563);
    box-shadow: 0 5px 15px rgba(107, 114, 128, 0.3);
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.letter-btn.secondary:hover {
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.4);
}

/* Footer Styles - Optimized */
.footer {
    background: linear-gradient(145deg, rgba(10, 10, 10, 0.95), rgba(26, 26, 46, 0.95));
    color: white;
    padding: 4rem 2rem 2rem;
    margin-top: 5rem;
    border-top: 1px solid rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.footer-section h4 {
    color: #be1c80;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-family: cursive;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.footer-section p {
    color: #94a3b8;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a {
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.3rem 0;
    display: inline-block;
}

.footer-section ul li a:hover {
    color: #00d4ff;
    transform: translateX(5px);
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    color: #64748b;
    font-size: 1rem;
}

.footer-bottom i {
    color: #be0a58;
    animation: heartbeat 2s infinite;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.4));
}

/* ANIMATIONS - OPTIMIZED */
@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes glow {
    0% {
        filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.4));
    }

    100% {
        filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.6));
    }
}

@keyframes floatHeart {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes floatSideImage {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Touch Optimization for Mobile */
@media (hover: none) and (pointer: coarse) {
    .photo-item:hover {
        transform: none;
    }

    .photo-item:active {
        transform: scale(0.98);
    }

    .photo-overlay {
        transform: translateY(0);
        background: rgba(10, 10, 10, 0.9);
    }

    .side-image:hover {
        transform: none;
    }
}

/* Responsive Design - Mobile First Approach */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background: rgba(10, 10, 10, 0.98);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
        padding: 2rem 0;
        gap: 1rem;
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(0, 212, 255, 0.3);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        padding: 1rem 2rem;
        border-radius: 10px;
        margin: 0 1rem;
    }

    .section {
        padding: 3rem 1.5rem;
    }

    .section-header h2 {
        font-size: 2.5rem;
    }

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

    .music-player {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        min-width: auto;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Photos Section - Mobile Optimization */
    .photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .photo-item img {
        height: 250px;
    }

    /* Home Side Images - Mobile */
    .home-side-images {
        display: none;
    }

    .book-controls {
        flex-direction: column;
        gap: 1.5rem;
    }

    .letter-envelope {
        width: 280px;
        height: 180px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
}

/* 576px Mobile Optimization - FIXED */
@media (max-width: 576px) {
    .nav-container {
        padding: 0 1rem;
    }

    .section {
        padding: 2.5rem 1rem;
    }

    .section-header h2 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .section-header p {
        font-size: 1.1rem;
    }

    .hero {
        min-height: 70vh;
        padding: 2rem 0;
    }

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

    .friendship-counter {
        padding: 2rem;
        margin: 2rem auto;
        max-width: 320px;
    }

    .counter-number {
        font-size: 3rem;
    }

    .counter-label {
        font-size: 1.1rem;
    }

    /* Music Player - Mobile Bottom */
    .music-player {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        min-width: 100%;
        border-radius: 0;
        padding: 1rem;
        border-top: 1px solid rgba(0, 212, 255, 0.3);
    }

    .player-controls button {
        font-size: 1rem;
        padding: 0.5rem;
    }

    .volume-control {
        display: none;
    }

    /* Photos Section - Mobile Optimized */
    .photo-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .photo-item {
        border-radius: 12px;
    }

    .photo-item img {
        height: 250px;
    }

    .photo-overlay {
        padding: 1.5rem 1rem 1rem;
    }

    .photo-overlay h4 {
        font-size: 1.2rem;
    }

    .photo-overlay p {
        font-size: 0.9rem;
    }

    /* Book Section - Mobile */
    .book {
        padding: 1.5rem;
        margin-bottom: 2rem;
        min-height: 350px;
    }

    .book-page {
        padding: 2rem;
        margin: 0.5rem;
        min-height: 280px;
    }

    .page-content h3 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .page-content p {
        font-size: 1rem;
        line-height: 1.8;
    }

    .book-controls {
        flex-direction: column;
        gap: 1rem;
        max-width: 100%;
    }

    .page-btn {
        width: 100%;
        justify-content: center;
        padding: 0.8rem 1.5rem;
    }

    /* Letter Section - Mobile */
    .letter-envelope {
        width: 240px;
        height: 160px;
    }

    .letter-paper {
        padding: 2rem;
    }

    .letter-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .letter-header h3 {
        font-size: 1.5rem;
    }

    .letter-date {
        font-size: 0.9rem;
    }

    #letterContent {
        font-size: 1rem;
        line-height: 1.8;
        min-height: 250px;
    }

    .letter-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .letter-btn {
        width: 100%;
        justify-content: center;
        padding: 0.8rem 1.5rem;
    }

    /* Modal - Mobile */
    .modal-content {
        max-width: 95%;
        max-height: 95%;
    }

    .modal-info {
        padding: 1.5rem;
    }

    .close-modal {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
        top: 1rem;
        right: 1rem;
    }

    .footer {
        padding: 3rem 1rem 1.5rem;
    }

    .footer-content {
        gap: 2rem;
    }

    .footer-section h4 {
        font-size: 1.2rem;
    }
}

/* 480px Extra Small Mobile */
@media (max-width: 480px) {
    .section {
        padding: 2rem 0.8rem;
    }

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

    .counter-number {
        font-size: 2.5rem;
    }

    .friendship-counter {
        padding: 1.5rem;
        max-width: 280px;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .music-player {
        padding: 0.8rem;
    }

    .player-info {
        max-width: 120px;
    }

    #songTitle {
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .photo-item img {
        height: 220px;
    }

    .letter-envelope {
        width: 200px;
        height: 140px;
    }

    .envelope-seal {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .book-page {
        padding: 1.5rem;
    }

    .page-content h3 {
        font-size: 1.3rem;
    }

    .footer {
        padding: 2rem 0.8rem 1rem;
    }
}

/* Performance Optimizations */
.photo-item,
.book-page,
.letter-envelope,
.side-image {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Scroll Indicator */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
}

.scroll-progress {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #8b5cf6);
    width: 0%;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: linear-gradient(145deg, #00d4ff, #8b5cf6);
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 212, 255, 0.3);
    z-index: 10000;
    animation: slideInRight 0.4s ease;
    border: 1px solid rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(10px);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Loading Animation */
body:not(.loaded) {
    overflow: hidden;
}

body:not(.loaded)::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

body:not(.loaded)::after {
    content: '💝';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    z-index: 10001;
    animation: heartbeat 1s infinite;
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
}

/* Focus Styles for Accessibility */
button:focus,
.nav-link:focus,
.photo-item:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .section {
        background: rgba(0, 0, 0, 0.9);
        color: white;
    }

    .nav-link {
        border: 1px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .floating-hearts,
    .heart {
        display: none;
    }
}

/* Print Styles */
@media print {

    .navbar,
    .music-player,
    .floating-hearts {
        display: none;
    }

    .section {
        page-break-inside: avoid;
        padding: 1rem;
    }

    body {
        background: white;
        color: black;
    }
}