:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-1: #3b82f6;
    --accent-2: #8b5cf6;
    --accent-3: #ec4899;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Dynamic Background Shapes */
.background-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite alternate ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-1);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-2);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: var(--accent-3);
    bottom: 20%;
    left: 20%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(100px, 50px) rotate(45deg); }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* Flashcard Styles */
.flashcard-container {
    width: 100%;
    height: 350px;
    perspective: 1000px; /* 3D effect */
    margin-bottom: 2rem;
    cursor: pointer;
}

.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.flashcard.is-flipped {
    transform: rotateX(180deg);
}

.flashcard-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 24px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    
    /* Glassmorphism */
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.flashcard-front {
    transform: rotateX(0deg);
}

.flashcard-back {
    transform: rotateX(180deg);
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.label {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--accent-1);
    background: rgba(59, 130, 246, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.flashcard-back .label {
    color: var(--accent-3);
    background: rgba(236, 72, 153, 0.1);
}

.flashcard p {
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.3;
    text-wrap: balance;
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    width: 100%;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.nav-btn:hover:not(:disabled) {
    background: var(--text-primary);
    color: var(--bg-color);
    transform: scale(1.1);
}

.nav-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.progress-indicator {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
    text-align: center;
}

#current-index {
    color: var(--text-primary);
    font-size: 1.3rem;
}

/* Actions */
.action-btn {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border: none;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.5);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(59, 130, 246, 0.6);
}

.action-btn:active {
    transform: translateY(1px);
}

/* Responsive */
@media (max-width: 640px) {
    .app-container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .flashcard p {
        font-size: 1.4rem;
    }
    
    .flashcard-container {
        height: 300px;
    }
}
