/* Global Styles */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --gray-color: #95a5a6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hidden {
    display: none !important;
}

/* Header Styles */
header {
    background-color: var(--dark-color);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.8rem;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover, nav a.active {
    color: var(--secondary-color);
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: var(--gray-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-success {
    background-color: var(--secondary-color);
    color: white;
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #d35400;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-color);
    transition: color 0.3s;
}

.btn-icon:hover {
    color: var(--warning-color);
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Auth Pages */
.auth-form {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.auth-form h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--dark-color);
}

/* Dashboard Styles */
.user-info {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.deck-actions {
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.decks-container {
    margin: 2rem 0;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-controls select {
    flex: 1;
    max-width: 200px;
}

.decks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.deck-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    position: relative;
}

.deck-card:hover {
    transform: translateY(-5px);
}

.deck-card h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.deck-card .category {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--light-color);
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.deck-card .progress-container {
    margin: 1rem 0;
}

.deck-card .progress-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.deck-card .progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.5s;
}

.deck-card .deck-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.deck-card .deck-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Deck Page Styles */
.deck-header {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.deck-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: #eee;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.5s;
}

.flashcard-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.flashcard {
    perspective: 1000px;
    height: 300px;
    margin: 0 auto 2rem;
    width: 100%;
    max-width: 500px;
    position: relative;
    cursor: pointer;
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.6s;
}

.flashcard-front {
    background: white;
    transform: rotateY(0deg);
}

.flashcard-back {
    background: var(--light-color);
    transform: rotateY(180deg);
}

.flashcard.flipped .flashcard-front {
    transform: rotateY(180deg);
}

.flashcard.flipped .flashcard-back {
    transform: rotateY(360deg);
}

.flashcard-actions, .difficulty-actions, .deck-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.card-list-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.card-list {
    margin-top: 1rem;
}

.card-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-item:last-child {
    border-bottom: none;
}

.card-item .difficulty {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.card-item .difficulty.easy {
    background: #d5f5e3;
    color: #27ae60;
}

.card-item .difficulty.medium {
    background: #fef9e7;
    color: #f39c12;
}

.card-item .difficulty.hard {
    background: #fadbd8;
    color: #e74c3c;
}

/* Responsive Styles */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }

    nav {
        margin-top: 1rem;
    }

    nav a {
        margin: 0 0.5rem;
    }

    .decks-grid {
        grid-template-columns: 1fr;
    }

    .flashcard-actions, .difficulty-actions, .deck-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
    }
}