/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #e9ecef 100%);
    color: #000000;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 60px;
    padding: 40px 0;
}

.header-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-text {
    flex: 1;
    text-align: center;
}

.header-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.logout-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(238, 90, 111, 0.3);
}

.logout-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(238, 90, 111, 0.4);
}

.logout-btn:active {
    transform: scale(0.98);
}

.title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 600;
    background: linear-gradient(45deg, #b8860b, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: #4169e1;
    font-weight: 300;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-buttons {
        margin-top: 10px;
    }
    
    .logout-btn:hover {
        transform: scale(1.05);
    }
    
    .title {
        font-size: 2.5rem;
    }
}

/* Globe Section */
.globe-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 80px 0;
    perspective: 1000px;
}

.globe-container {
    position: relative;
    width: 300px;
    height: 300px;
}

.globe {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: visible;
    box-shadow: 
        0 0 30px rgba(65, 105, 225, 0.3),
        inset 0 0 30px rgba(184, 134, 11, 0.1);
    background: #f8f9fa;
}

.globe-surface {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: 
        url('./9e1f39f1-b01f-462d-b297-8555ab258b89.png'),
        url('./9e1f39f1-b01f-462d-b297-8555ab258b89.png');
    background-size: 200% 100%, 200% 100%;
    background-repeat: no-repeat, no-repeat;
    background-position: 0% 0%, 200% 0%;
    animation: rotateMap 20s linear infinite;
    position: relative;
}

.globe-surface::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 30%, transparent 70%, rgba(65, 105, 225, 0.1) 100%),
        radial-gradient(circle at 70% 70%, transparent 70%, rgba(184, 134, 11, 0.1) 100%);
    border-radius: 50%;
}

@keyframes rotateMap {
    0% { 
        background-position: 0% 0%, 200% 0%; 
    }
    100% { 
        background-position: -200% 0%, 0% 0%; 
    }
}

/* Orbit System - Photos move horizontally across globe equator creating orbit illusion */
.orbit-container {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 50px;
    margin-top: -25px;
    pointer-events: none;
}

.orbiting-photo {
    position: absolute;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 3px solid #b8860b;
    box-shadow: 
        0 0 15px rgba(184, 134, 11, 0.6),
        0 0 25px rgba(65, 105, 225, 0.4);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: moveAcrossGlobe 15s linear infinite;
    pointer-events: auto;
}

.orbiting-photo:hover {
    transform: scale(1.3);
    box-shadow: 
        0 0 20px rgba(184, 134, 11, 0.9),
        0 0 35px rgba(65, 105, 225, 0.6);
}

.orbiting-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Stacking system for multiple photos - spaced for large photos */
.orbiting-photo:nth-child(1) { z-index: 10; }
.orbiting-photo:nth-child(2) { z-index: 9; animation-delay: -3s; }
.orbiting-photo:nth-child(3) { z-index: 8; animation-delay: -6s; }
.orbiting-photo:nth-child(4) { z-index: 7; animation-delay: -9s; }
.orbiting-photo:nth-child(5) { z-index: 6; animation-delay: -12s; }
.orbiting-photo:nth-child(6) { z-index: 5; animation-delay: -15s; }
.orbiting-photo:nth-child(7) { z-index: 4; animation-delay: -18s; }
.orbiting-photo:nth-child(8) { z-index: 3; animation-delay: -21s; }
.orbiting-photo:nth-child(9) { z-index: 2; animation-delay: -24s; }
.orbiting-photo:nth-child(10) { z-index: 1; animation-delay: -27s; }

@keyframes moveAcrossGlobe {
    0% {
        left: -80px;
        opacity: 0.3;
        transform: scale(0.4);
    }
    10% {
        left: 10%;
        opacity: 0.8;
        transform: scale(1.5);
    }
    50% {
        left: 50%;
        opacity: 1;
        transform: scale(2.5);
    }
    90% {
        left: 90%;
        opacity: 0.8;
        transform: scale(1.5);
    }
    100% {
        left: calc(100% + 80px);
        opacity: 0.3;
        transform: scale(0.4);
    }
}

/* Upload Section */
.upload-section {
    margin: 80px 0;
    text-align: center;
}

.upload-container h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: #b8860b;
    margin-bottom: 40px;
}

.upload-area {
    border: 3px dashed #4169e1;
    border-radius: 20px;
    padding: 60px 40px;
    background: rgba(0, 0, 0, 0.02);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 600px;
    margin: 0 auto;
}

.upload-area:hover {
    border-color: #b8860b;
    background: rgba(184, 134, 11, 0.05);
    transform: translateY(-5px);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.upload-area p {
    font-size: 1.2rem;
    color: #4169e1;
}

/* Scrapbook Section */
.scrapbook-section {
    margin: 80px 0;
}

.scrapbook-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: #b8860b;
    text-align: center;
    margin-bottom: 50px;
}

.scrapbook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.scrapbook-item {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(184, 134, 11, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.scrapbook-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(184, 134, 11, 0.2);
    border-color: #b8860b;
}

.scrapbook-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scrapbook-item:hover .scrapbook-actions {
    opacity: 1;
}

.delete-btn, .edit-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.delete-btn:hover {
    background: rgba(244, 67, 54, 0.9);
    color: white;
    transform: scale(1.1);
}

.edit-btn:hover {
    background: rgba(65, 105, 225, 0.9);
    color: white;
    transform: scale(1.1);
}

.scrapbook-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.scrapbook-content {
    padding: 20px;
}

.scrapbook-date {
    color: #4169e1;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.scrapbook-thought {
    color: #000000;
    line-height: 1.6;
    font-size: 1rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    margin: 5% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    border: 1px solid rgba(184, 134, 11, 0.3);
    position: relative;
}

.close {
    color: #4169e1;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #b8860b;
}

.modal-content h3 {
    font-family: 'Playfair Display', serif;
    color: #b8860b;
    margin-bottom: 20px;
    text-align: center;
}

#modalImage {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
}

#thoughtInput {
    width: 100%;
    height: 120px;
    padding: 15px;
    border: 1px solid rgba(65, 105, 225, 0.3);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.02);
    color: #000000;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 20px;
}

#thoughtInput::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

#saveThought {
    background: linear-gradient(45deg, #b8860b, #ffd700);
    color: #000000;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

#saveThought:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(184, 134, 11, 0.3);
}

.ai-button {
    background: linear-gradient(45deg, #4169e1, #87ceeb);
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

.ai-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(65, 105, 225, 0.3);
}

/* AI Social Media Modal */
.social-modal {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.ai-loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(184, 134, 11, 0.3);
    border-top: 4px solid #b8860b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ai-content {
    padding: 20px 0;
}

.social-idea {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(184, 134, 11, 0.2);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.social-idea:hover {
    border-color: #b8860b;
    box-shadow: 0 5px 15px rgba(184, 134, 11, 0.1);
}

.idea-title {
    font-family: 'Playfair Display', serif;
    color: #b8860b;
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.idea-content {
    color: #000000;
    line-height: 1.6;
    margin-bottom: 15px;
}

.copy-button {
    background: linear-gradient(45deg, #b8860b, #ffd700);
    color: #000000;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(184, 134, 11, 0.3);
}

.copy-button.copied {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
}

.idea-type {
    display: inline-block;
    background: linear-gradient(45deg, #4169e1, #87ceeb);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 10px;
}

/* Custom Confirmation Modal */
.confirm-modal {
    max-width: 400px;
    text-align: center;
}

.confirm-modal h3 {
    color: #b8860b;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.confirm-modal p {
    color: #000000;
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.cancel-btn, .delete-btn-confirm {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.cancel-btn {
    background: linear-gradient(45deg, #4169e1, #87ceeb);
    color: white;
}

.cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(65, 105, 225, 0.3);
}

.delete-btn-confirm {
    background: linear-gradient(45deg, #f44336, #d32f2f);
    color: white;
}

.delete-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(244, 67, 54, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .globe-container {
        width: 200px;
        height: 200px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .scrapbook-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }
    
    .globe-container {
        width: 150px;
        height: 150px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
}

/* ===================================
   BIRTHDAY LETTER STYLES
   =================================== */

/* Letter Button in Header */
.letter-btn {
    background: linear-gradient(135deg, #FF6B9D 0%, #C44569 100%);
    border: none;
    padding: 12px 18px;
    border-radius: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
    animation: heartbeat 2s infinite;
}

.letter-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 107, 157, 0.5);
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10% { transform: scale(1.05); }
    20% { transform: scale(1); }
}

/* Letter Modal */
.letter-modal {
    background: linear-gradient(135deg, #FFF5F7 0%, #FFE5EC 100%);
    padding: 0;
    border-radius: 20px;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close-letter {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    color: #C44569;
    font-weight: bold;
}

.close-letter:hover {
    background: #C44569;
    color: white;
    transform: rotate(90deg) scale(1.1);
}

.letter-container {
    padding: 50px 40px;
    opacity: 0;
    transform: scale(0.8) rotateX(-10deg);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.letter-container.letter-open {
    opacity: 1;
    transform: scale(1) rotateX(0);
}

.letter-header {
    text-align: center;
    margin-bottom: 30px;
}

.birthday-decoration {
    font-size: 2.5rem;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.letter-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: #C44569;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(196, 69, 105, 0.1);
}

.letter-body {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.letter-body::before {
    content: '💖';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 4rem;
    opacity: 0.1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.1; transform: scale(1); }
    50% { opacity: 0.2; transform: scale(1.1); }
}

.letter-greeting {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: #555;
    margin: 0 0 20px 0;
    font-style: italic;
}

.letter-main {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: #C44569;
    margin: 0 0 25px 0;
    line-height: 1.4;
}

.letter-text {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    color: #444;
    line-height: 1.8;
    margin: 0 0 20px 0;
}

.letter-closing {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    color: #555;
    font-style: italic;
    margin: 30px 0 10px 0;
}

.letter-signature {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: #C44569;
    margin: 0;
}

.letter-year {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #888;
    margin: 5px 0 0 0;
}

.letter-footer {
    margin-top: 30px;
    text-align: center;
    position: relative;
    height: 50px;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #FF6B9D;
    animation: confettiFloat 3s ease-in-out infinite;
}

.confetti-piece:nth-child(1) {
    left: 10%;
    background: #FF6B9D;
    animation-delay: 0s;
}

.confetti-piece:nth-child(2) {
    left: 30%;
    background: #FFC048;
    animation-delay: 0.5s;
}

.confetti-piece:nth-child(3) {
    left: 50%;
    background: #A29BFE;
    animation-delay: 1s;
}

.confetti-piece:nth-child(4) {
    left: 70%;
    background: #FF4757;
    animation-delay: 1.5s;
}

.confetti-piece:nth-child(5) {
    left: 90%;
    background: #6C5CE7;
    animation-delay: 2s;
}

@keyframes confettiFloat {
    0%, 100% { 
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    50% { 
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.7;
    }
}

/* Confetti Animation */
.confetti-animation {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 9999;
    pointer-events: none;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .letter-modal {
        max-width: 95%;
        margin: 20px;
    }
    
    .letter-container {
        padding: 40px 25px;
    }
    
    .letter-body {
        padding: 30px 20px;
    }
    
    .letter-title {
        font-size: 2rem;
    }
    
    .letter-main {
        font-size: 1.5rem;
    }
    
    .letter-text {
        font-size: 1rem;
    }
    
    .birthday-decoration {
        font-size: 2rem;
    }
}
