/* css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
    --primary-color: #2D3748; 
    --accent-color: #38A169;  
    --bg-color: #F7FAFC;      
    --card-bg: #FFFFFF;
    --text-color: #2D3748;
    --text-light: #718096;
    --border-color: #E2E8F0;
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --body-transition: background-color 0.3s ease, color 0.3s ease;
}

.dark-theme {
    --primary-color: #E2E8F0;
    --accent-color: #38A169;
    --bg-color: #1A202C;
    --card-bg: #2D3748;
    --text-color: #F7FAFC;
    --text-light: #A0AEC0;
    --border-color: #4A5568;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Poppins', sans-serif; background-color: var(--bg-color); color: var(--text-color); line-height: 1.7; transition: var(--body-transition); }

.container > * { opacity: 0; animation: slideUpFadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.card-grid > *, .list-container > * { opacity: 0; animation: slideUpFadeIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.card-grid .card:nth-child(1) { animation-delay: 0.1s; } .card-grid .card:nth-child(2) { animation-delay: 0.2s; }
.card-grid .card:nth-child(3) { animation-delay: 0.3s; } .card-grid .card:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideUpFadeIn {
    from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); }
}

.container { max-width: 1100px; margin: 2rem auto; padding: 0 2rem; }
.main-header { display: flex; justify-content: space-between; align-items: center; background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(10px); padding: 1rem 2rem; box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; transition: background-color 0.3s ease, box-shadow 0.3s ease; }
.dark-theme .main-header { background: rgba(26, 32, 44, 0.7); }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); text-decoration: none; }
.homepage .hero { text-align: center; padding: 4rem 0 2rem 0; }
.homepage h1 { font-size: 3.5rem; margin-bottom: 1rem; }
.homepage p { font-size: 1.25rem; color: var(--text-light); margin-bottom: 2.5rem; }
.homepage .class-selection { padding: 0; text-align: center; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-top: 1rem; }
.card { background: var(--card-bg); padding: 2rem; border-radius: 15px; text-align: center; text-decoration: none; color: var(--text-color); font-size: 1.2rem; font-weight: 600; box-shadow: var(--shadow-light); border: 1px solid var(--border-color); transition: all 0.3s ease; }
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-medium); }
.card.disabled { opacity: 0.6; cursor: not-allowed; background: #f1f1f1; color: var(--text-light); }
.dark-theme .card.disabled { background: #333a48; }

.class-card { position: relative; overflow: hidden; }
.class-card::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: radial-gradient(circle at var(--mouse-x) var(--mouse-y), rgba(113, 128, 150, 0.2), transparent 40%); opacity: 0; transition: opacity 0.3s; }
.class-card:hover::before { opacity: 1; }
.class-card .card-icon, .class-card .card-text { position: relative; z-index: 2; }
.class-card .card-icon { transition: transform 0.3s ease; }
.class-card:hover .card-icon { transform: scale(1.15) rotate(-8deg); }

.list-container { background: var(--card-bg); border-radius: 15px; box-shadow: var(--shadow-light); margin-top: 2rem; overflow: hidden; border: 1px solid var(--border-color); }
.list-item { display: block; padding: 1.5rem 2rem; text-decoration: none; color: var(--text-color); border-bottom: 1px solid var(--border-color); font-weight: 600; transition: background-color 0.2s; position: relative; }
.list-item:hover { background-color: rgba(113, 128, 150, 0.1); }
.dark-theme .list-item:hover { background-color: rgba(255, 255, 255, 0.05); }

.theme-toggle { background: none; border: none; cursor: pointer; padding: 0.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.theme-toggle svg { width: 24px; height: 24px; stroke: var(--text-color); transition: all 0.3s ease; }
.theme-toggle:hover svg { stroke: var(--accent-color); transform: rotate(15deg) scale(1.1); }
.theme-toggle .moon { display: none; }
.dark-theme .theme-toggle .moon { display: block; }
.dark-theme .theme-toggle .sun { display: none; }

#flashcard-app { min-height: 80vh; }
.loading { font-size: 1.5rem; text-align: center; padding-top: 5rem; color: var(--text-light); }
.filter-nav { margin-bottom: 2rem; display: flex; justify-content: center; gap: 1rem; }
.filter-btn { padding: 0.75rem 1.5rem; font-size: 1rem; font-weight: 600; cursor: pointer; border: 2px solid var(--border-color); border-radius: 50px; background-color: var(--card-bg); color: var(--primary-color); transition: all 0.3s ease; }
.filter-btn:hover { border-color: var(--primary-color); }
.filter-btn.active { background-color: var(--primary-color); color: var(--card-bg); border-color: var(--primary-color); box-shadow: 0 4px 15px rgba(45, 55, 72, 0.2); }
.dark-theme .filter-btn.active { box-shadow: 0 4px 15px rgba(226, 232, 240, 0.2); }

.flashcard-scene { width: 600px; height: 400px; perspective: 1800px; margin: 20px auto; }
.flashcard { width: 100%; height: 100%; position: relative; cursor: pointer; transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1); transform-style: preserve-3d; box-shadow: var(--shadow-medium); border-radius: 20px; }
.flashcard-scene:hover .flashcard { box-shadow: 0 20px 40px rgba(0,0,0,0.15); }
.flashcard.is-flipped { transform: rotateY(180deg) scale(1.05); }
.card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; justify-content: center; align-items: center; padding: 30px; box-sizing: border-box; border-radius: 20px; font-size: 1.8rem; text-align: center; font-weight: 600; background-color: var(--card-bg); color: var(--text-color); }
.card-back { transform: rotateY(180deg); color: white; background: linear-gradient(135deg, #4A90E2 0%, #764ba2 100%); }
.dark-theme .card-back { background: linear-gradient(135deg, var(--accent-color) 0%, #2b6cb0 100%); }
.navigation { display: flex; justify-content: space-between; align-items: center; width: 600px; margin: 2rem auto 0 auto; }
.nav-button { width: 60px; height: 60px; font-size: 2.2rem; cursor: pointer; border: none; border-radius: 50%; background-color: var(--card-bg); color: var(--primary-color); box-shadow: var(--shadow-light); transition: all 0.2s ease-in-out; }
.nav-button:hover { transform: translateY(-4px); box-shadow: var(--shadow-medium); }
#counter { font-size: 1.5rem; color: var(--text-color); font-weight: 600; }
#no-cards-message { font-size: 1.2rem; color: var(--text-light); height: 400px; display: flex; justify-content: center; align-items: center; }

.feedback-section { width: 600px; margin: 4rem auto 2rem auto; padding: 2rem; background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; box-shadow: var(--shadow-light); text-align: center; transition: all 0.3s ease; }
.feedback-section h2 { font-size: 1.8rem; color: var(--text-color); margin-bottom: 0.5rem; }
.feedback-section p { color: var(--text-light); margin-bottom: 1.5rem; }
.feedback-form textarea { width: 100%; min-height: 100px; padding: 1rem; border-radius: 10px; border: 1px solid var(--border-color); background-color: var(--bg-color); color: var(--text-color); font-family: 'Poppins', sans-serif; font-size: 1rem; resize: vertical; margin-bottom: 1rem; transition: all 0.3s ease; }
.feedback-form textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2); }
.btn-submit { display: inline-block; padding: 0.8rem 2rem; border-radius: 50px; text-decoration: none; font-weight: 600; transition: all 0.3s ease; background-color: var(--accent-color); color: #fff; border: none; cursor: pointer; font-size: 1rem; }
.btn-submit:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(56, 161, 105, 0.3); }