/* --- NEW FONTS & THEME --- */
:root { 
    --font-main: 'Montserrat', sans-serif; 
    --font-quote: 'Playfair Display', serif; 
    --color-primary: #9b59b6; 
    --color-secondary: #8e44ad; 
    --color-accent: #e91e63; 
    --color-text: #ecf0f1; 
    --color-dark-bg: #2c003e; 
    --color-dark-surface: #4a148c; 
}

/* --- General Styles & Resets --- */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: var(--font-main); 
}

body {
     display: flex; 
     overflow: hidden; 
}

/* --- Background Cross-Fade System --- */
.background-layer { 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; 
    height: 100%; 
    background-size: cover; 
    z-index: -1; 
    transition: opacity 1.5s ease-in-out; 
}

#bg-1 { 
    opacity: 1; 
}

#bg-2 { 
    opacity: 0; 
}

/* --- Welcome Modal --- */
#welcome-modal { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.9); 
    z-index: 200; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
    color: var(--color-text); 
    transition: opacity 0.5s ease-in-out, visibility 0.5s; 
}

#welcome-modal.hidden { 
    opacity: 0; 
    visibility: hidden; 
}

.modal-content { 
    background: var(--color-dark-bg); 
    padding: 40px; 
    border-radius: 15px; 
    max-width: 500px; 
    width: 90%; 
    border: 1px solid var(--color-secondary); 
}

.modal-content h2 { 
    font-size: 2rem; 
    margin-bottom: 10px; 
    font-family: var(--font-quote); 
    font-weight: 700; 
}

.modal-content p { 
    font-size: 1.1rem; 
    margin-bottom: 30px; 
    line-height: 1.6; 
    color: #bdc3c7; 
}

.choices { 
    display: flex; 
    justify-content: center; 
    gap: 15px; 
}

#start-app-btn { 
    background: var(--color-accent); 
    color: white; 
    border: none; 
    padding: 15px 30px; 
    border-radius: 50px; 
    font-size: 1.1rem; 
    font-weight: bold; 
    cursor: pointer; 
    text-decoration: none; 
    transition: background-color 0.3s, transform 0.2s; 
}

#start-app-btn:hover { 
    background-color: #c2185b; 
    transform: scale(1.05); 
}

/* --- Sidebar Navigation --- */
#mood-sidebar { 
    width: 240px; 
    height: 100vh; 
    background: var(--color-dark-bg); 
    color: var(--color-text); 
    padding: 20px; 
    flex-shrink: 0; 
    box-shadow: 5px 0 15px rgba(0,0,0,0.3); 
}

#mood-sidebar h2 { 
    text-align: center; 
    margin-bottom: 30px; 
    font-weight: 400; 
}

#mood-sidebar ul { 
    list-style: none; 
}

#mood-sidebar ul li { 
    margin-bottom: 15px; 
}

.mood-btn { 
    width: 100%; 
    background: var(--color-dark-surface); 
    color: var(--color-text); 
    border: 1px solid var(--color-secondary); 
    padding: 15px; 
    border-radius: 8px; 
    font-size: 1rem; 
    text-align: left; 
    cursor: pointer; 
    transition: all 0.3s ease; 
}

.mood-btn.active { 
    background-color: var(--color-primary); 
    color: white; 
    transform: translateX(10px) scale(1.02); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); 
}

.mood-btn:hover { 
    background-color: var(--color-secondary); 
}

/* --- Main Application Area --- */
#main-app { 
    flex-grow: 1; 
    height: 100vh; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    padding: 20px; 
    overflow-y: auto; 
}

.container { 
    width: 100%; 
    max-width: 600px; 
}

.app-controls { 
    position: fixed; 
    top: 20px; 
    right: 20px; 
    z-index: 10; 
}

.app-controls button { 
    background: rgba(0, 0, 0, 0.4); 
    color: white; 
    border: 1px solid rgba(255,255,255,0.2); 
    font-size: 1.2rem; 
    width: 50px; 
    height: 50px; 
    border-radius: 50%; 
    cursor: pointer; 
    transition: all 0.3s; 
}

.app-controls button:hover { 
    background: rgba(0, 0, 0, 0.7); 
    transform: scale(1.1); 
}

/* --- Quote Display Area --- */
.main-content { 
    background-color: rgba(10, 0, 20, 0.75); 
    color: var(--color-text); 
    border-radius: 15px; 
    padding: 40px; 
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); 
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37); 
    min-height: 300px; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    position: relative; 
}

.quote-wrapper { 
    opacity: 1; 
    transition: opacity 0.4s ease-in-out;
 }

.text-area { 
    font-family: var(--font-quote); 
    font-size: 1.8rem; 
    line-height: 1.6; 
    font-style: italic; 
    font-weight: 400; 
}

.person { 
    font-size: 1.2rem; 
    font-weight: bold; 
    color: var(--color-primary); 
    text-transform: uppercase; 
    margin-top: 20px; 
}

/* --- Buttons --- */
.button-area { 
    margin-top: 20px; 
}

#new-quote-btn { 
    background-color: var(--color-accent); 
    color: white; 
    font-size: 1.1rem; 
    font-weight: bold; 
    padding: 12px 25px; 
    border-radius: 50px; 
    border: none; 
    cursor: pointer; 
    transition: all 0.3s ease; 
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4); 
}

#new-quote-btn:hover { 
    background-color: #c2185b; 
    transform: scale(1.05); 
}

/* --- Actions & Share Buttons --- */
.actions { 
    margin-top: 20px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 20px; 
}

.actions button { 
    background: none; 
    border: none;
    color: #ddd; 
    font-size: 1.5rem; 
    cursor: pointer; 
    transition: color 0.3s, transform 0.2s; 
}

.actions button:hover { 
    transform: scale(1.2); 
}

#favorite-btn.favorited { 
    color: var(--color-accent); 
    transform: scale(1.2); 
}

#copy-btn:hover { 
    color: #3498db; 
}

#twitter-btn:hover { 
    color: #1da1f2; 
}


/* --- Tooltip for Copy Button --- */
.tooltip { 
    position: absolute; 
    bottom: -35px; 
    left: 50%; 
    transform: translateX(-50%); 
    background-color: #333; 
    color: white; 
    padding: 5px 10px; 
    border-radius: 5px; 
    font-size: 0.9rem; 
    opacity: 0; 
    transition: opacity 0.3s; 
    pointer-events: none; 
}

.tooltip.visible { 
    opacity: 1; 
}

/* --- Favorites Panel --- */
.side-panel { 
    position: fixed; 
    top: 0; 
    right: -400px; 
    width: 100%; 
    max-width: 350px; 
    height: 100%; 
    background: var(--color-dark-bg); 
    z-index: 100; 
    box-shadow: -5px 0 15px rgba(0,0,0,0.5); 
    display: flex; 
    flex-direction: column; 
    transition: right 0.4s ease-in-out; 
}

.side-panel.open { 
    right: 0; 
}

.panel-header { 
    padding: 20px; 
    background: var(--color-dark-surface); 
    color: white; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.close-panel-btn { 
    background: none; 
    border: none; 
    color: white; 
    font-size: 1.5rem; 
    cursor: pointer; 
}

.panel-list { 
    padding: 20px; 
    overflow-y: auto; 
    color: var(--color-text); 
}

.panel-list-item { 
    position: relative; 
    padding: 15px; 
    padding-right: 40px; 
    background: var(--color-dark-surface); 
    border-radius: 5px; 
    margin-bottom: 10px; 
    text-align: left; 
}

.panel-list-item p { 
    font-family: var(--font-quote); font-style: italic; 
}

.panel-list-item span { 
    display: block; 
    margin-top: 10px; 
    font-weight: bold; 
    color: var(--color-primary); 
}

.delete-item-btn { 
    position: absolute; 
    top: 5px; 
    right: 5px; 
    background: none; 
    border: none; 
    color: #bdc3c7; 
    font-size: 1.5rem; 
    font-weight: bold; 
    cursor: pointer; 
    transition: color 0.3s; 
}

.delete-item-btn:hover { 
    color: var(--color-accent); 
}