:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --bg-gradient-1: #fdfbfb;
    --bg-gradient-2: #ebedee;
    --text-color: #2d3436;
    --text-light: #636e72;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Quicksand', sans-serif;
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    overflow: hidden;
    position: relative;
    transition: background 1s ease;
}

/* Dynamic Themes */
body.theme-motivation { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%); }
body.theme-life { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }
body.theme-positivity { background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%); }
body.theme-wisdom { background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%); }
body.theme-creativity { background: linear-gradient(135deg, #fccb90 0%, #d57eeb 100%); }

/* Zen Mode */
body.zen-mode .container > *:not(main),
body.zen-mode .controls,
body.zen-mode .background-shapes,
body.zen-mode .zen-controls {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

body.zen-mode .quote-card {
    background: transparent;
    box-shadow: none;
    border: none;
    transform: scale(1.1);
}

body.zen-mode #quote-text {
    font-size: 2.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.zen-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.sound-controls {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mini-select {
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
}

/* Background Shapes for visual interest */
.background-shapes .shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    animation: float 20s infinite;
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: rgba(162, 155, 254, 0.4);
    animation-delay: 0s;
}

.shape-2 {
    bottom: -10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(129, 236, 236, 0.4);
    animation-delay: -5s;
}

.shape-3 {
    top: 40%;
    left: 40%;
    width: 300px;
    height: 300px;
    background: rgba(250, 177, 160, 0.4);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -50px) rotate(10deg); }
    66% { transform: translate(-20px, 20px) rotate(-5deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.container {
    width: 90%;
    max-width: 600px;
    text-align: center;
    z-index: 1;
}

header {
    margin-bottom: 2rem;
}

h1 {
    font-size: 3rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    font-weight: 500;
}

.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    padding: 3rem 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-effect:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.15);
}

.quote-content {
    margin-bottom: 2rem;
    position: relative;
}

.quote-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    opacity: 0.3;
    position: absolute;
    top: -10px;
    left: -10px;
}

.quote-icon-end {
    font-size: 1.5rem;
    color: var(--primary-color);
    opacity: 0.3;
    position: absolute;
    bottom: -10px;
    right: -10px;
}

#quote-text {
    font-size: 1.5rem;
    line-height: 1.6;
    font-weight: 500;
    color: var(--text-color);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quote-author {
    margin-bottom: 2.5rem;
    font-style: italic;
    color: var(--text-light);
    font-weight: 500;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.glass-input {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-family: inherit;
    color: var(--text-color);
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.glass-input:hover {
    background: rgba(255, 255, 255, 0.8);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 1rem;
    transition: color 0.3s ease, transform 0.2s ease;
}

.icon-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 auto;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

footer {
    margin-top: 2rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.text-btn {
    background: none;
    border: none;
    color: white;
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
    opacity: 0.8;
}

.text-btn:hover {
    opacity: 1;
}

/* Favorites Panel */
#favorites-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 20;
    display: flex;
    flex-direction: column;
}

#favorites-panel.hidden {
    display: none;
}

#favorites-panel h3 {
    margin-bottom: 1rem;
    text-align: center;
}

#favorites-list {
    list-style: none;
    padding: 0;
}

#favorites-list li {
    background: rgba(255,255,255,0.3);
    margin-bottom: 0.5rem;
    padding: 0.8rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

#favorites-list li button {
    background: none;
    border: none;
    color: #ff7675;
    cursor: pointer;
    margin-left: 0.5rem;
}

#close-fav-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

footer i {
    color: #ff7675;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    h1 { font-size: 2rem; }
    .glass-effect { padding: 2rem 1.5rem; }
    #quote-text { font-size: 1.2rem; }
    .controls { flex-direction: column; gap: 1rem; }
    .action-buttons { width: 100%; display: flex; justify-content: center; gap: 1rem; }
    .icon-btn { margin: 0; }
}
