/* ===== Google Fonts Import ===== */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --accent-teal: #00d9c0;
    --accent-coral: #ff6b5b;
    --accent-gold: #ffc857;
    --text-primary: #f5f5f7;
    --text-muted: rgba(245, 245, 247, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shine: rgba(255, 255, 255, 0.05);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    background: var(--bg-primary);
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-primary);
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* ===== Animated Background Elements ===== */
/* Gradient Glow */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(0, 217, 192, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(255, 107, 91, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 50% 30% at 50% 80%, rgba(255, 200, 87, 0.04) 0%, transparent 50%);
    z-index: 0;
    animation: bgPulse 10s ease-in-out infinite alternate;
    pointer-events: none;
}

/* Floating Orb */
body::after {
    content: '';
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-teal), transparent);
    filter: blur(120px);
    opacity: 0.12;
    top: -200px;
    left: -200px;
    animation: orbFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes bgPulse { 
    0% { opacity: 0.5; transform: scale(1); } 
    100% { opacity: 0.8; transform: scale(1.1); } 
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(150px, 100px) scale(1.2); }
}

/* ===== Glass Containers ===== */
.container, .dashboard-container {
    position: relative;
    z-index: 2;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 90%;
    max-width: 420px;
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.5),
        0 0 0 1px var(--glass-shine) inset,
        0 1px 0 var(--glass-shine) inset;
    animation: fadeInUp 0.8s var(--transition-smooth) forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Decorative Top Line (Dada ke upar decoration) */
.container::before, .dashboard-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-teal), var(--accent-coral), transparent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 10;
}

/* Glass Shine Effect */
.container::after, .dashboard-container::after {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    margin-top: 1px;
}

/* Dashboard Specifics */
.dashboard-container {
    max-width: 700px;
    padding: 40px;
    padding-top: 50px; /* Space for logout btn */
}

/* ===== Typography ===== */
h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 600;
    text-align: center;
    margin-bottom: 32px;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

/* ===== Input Fields ===== */
input {
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 400;
    transition: all var(--transition-fast);
    outline: none;
    position: relative;
}

input::placeholder { color: var(--text-muted); }

input:hover { border-color: rgba(255, 255, 255, 0.15); }

input:focus {
    border-color: var(--accent-teal);
    background: rgba(0, 217, 192, 0.05);
    box-shadow: 0 0 0 3px rgba(0, 217, 192, 0.15);
}

/* ===== Main Action Buttons (Login/Signup) ===== */
#loginBtn, #signupBtn {
    width: 100%;
    padding: 16px;
    margin-top: 10px;
    border-radius: var(--radius-md);
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-smooth);
    
    /* Gradient Background */
    background: linear-gradient(135deg, var(--accent-teal), #00b8a9);
    color: var(--bg-primary);
    box-shadow: 0 8px 20px rgba(0, 217, 192, 0.3);
}

#loginBtn:hover, #signupBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 217, 192, 0.4);
}

/* Shine animation on button hover */
#loginBtn::after, #signupBtn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: 0.5s;
}
#loginBtn:hover::after, #signupBtn:hover::after {
    left: 100%;
}

/* ===== Paragraph & Links ===== */
p {
    text-align: center;
    margin-top: 28px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

a {
    color: var(--accent-teal);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0;
    width: 0; height: 1px;
    background: var(--accent-teal);
    transition: width 0.3s;
}

a:hover { color: var(--accent-gold); }
a:hover::after { width: 100%; background: var(--accent-gold); }

/* ===== Dashboard Elements ===== */

/* Logout Button - Compact & Stylish */
#logoutBtn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: auto; /* Fixed width issue */
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 107, 91, 0.3);
    background: rgba(255, 107, 91, 0.1);
    color: var(--accent-coral);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
}

#logoutBtn:hover {
    background: var(--accent-coral);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 91, 0.3);
    transform: translateY(-2px);
}

/* Add Quote Section */
.add-quote {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
}

.add-quote input {
    flex: 1;
    margin-bottom: 0; /* Align perfectly with button */
}

/* Add Quote Button - Compact */
#addQuoteBtn {
    width: auto; /* Fixed width issue */
    padding: 0 24px;
    border-radius: var(--radius-md);
    border: none;
    background: linear-gradient(135deg, var(--accent-teal), #00b8a9);
    color: var(--bg-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 217, 192, 0.2);
}

#addQuoteBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 217, 192, 0.35);
}

/* ===== Quote List ===== */
#quoteList {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Custom Scrollbar */
#quoteList::-webkit-scrollbar { width: 5px; }
#quoteList::-webkit-scrollbar-track { background: transparent; }
#quoteList::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
#quoteList::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Quote Item Card */
#quoteList li {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--accent-teal); /* Accent bar */
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

#quoteList li:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
    border-left-color: var(--accent-gold);
}

/* Quote Buttons Container (assuming you add buttons via JS) */
#quoteList li button {
    width: auto;
    padding: 6px 14px;
    margin-left: 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

/* Edit/Copy Button */
#quoteList li button:first-of-type {
    background: rgba(0, 217, 192, 0.1);
    color: var(--accent-teal);
}
#quoteList li button:first-of-type:hover {
    background: rgba(0, 217, 192, 0.2);
}

/* Delete Button */
#quoteList li button:last-of-type {
    background: rgba(255, 107, 91, 0.1);
    color: var(--accent-coral);
}
#quoteList li button:last-of-type:hover {
    background: rgba(255, 107, 91, 0.2);
}

/* Empty State Message */
#quoteList:empty::after {
    content: 'No quotes yet. Add your first one above!';
    display: block;
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius-md);
    margin-top: 10px;
}

/* ===== Responsive Fixes ===== */
@media (max-width: 768px) {
    .dashboard-container { padding: 30px 24px; padding-top: 70px; }
    .add-quote { flex-direction: column; }
    /* Make Add btn full width on mobile */
    #addQuoteBtn { width: 100%; padding: 16px; }
    
    /* Adjust Logout btn on mobile */
    #logoutBtn { top: 15px; right: 15px; }
    
    #quoteList li { flex-direction: column; align-items: flex-start; }
    #quoteList li button { margin-left: 0; margin-top: 10px; }
}

/* ===== Accessibility Focus ===== */
:focus-visible {
    outline: 2px solid var(--accent-teal);
    outline-offset: 2px;
}
