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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

nav {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 0.8;
}

.nav-links button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-links button:hover {
    background-color: #c0392b;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    min-height: calc(100vh - 200px);
}

.auth-container {
    max-width: 400px;
    margin: 4rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.auth-container h1 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #2c3e50;
}

.form-group input {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.form-group small {
    color: #7f8c8d;
    font-size: 0.875rem;
}

.auth-form button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.auth-form button:hover {
    background-color: #2980b9;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
    color: #7f8c8d;
}

.auth-link a {
    color: #3498db;
    text-decoration: none;
}

.auth-link a:hover {
    text-decoration: underline;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    margin-bottom: 1rem;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
    margin-bottom: 1rem;
}

footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

footer p {
    margin: 0;
}

/* Common Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-study {
    background-color: #27ae60;
    color: white;
}

.btn-study:hover {
    background-color: #229954;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Decks */
.decks-container {
    max-width: 1200px;
    margin: 0 auto;
}

.decks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.decks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.deck-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.deck-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.deck-card-header h3 {
    margin: 0;
}

.deck-card-header h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.deck-card-header h3 a:hover {
    color: #3498db;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.badge-public {
    background-color: #d4edda;
    color: #155724;
}

.badge-private {
    background-color: #f8d7da;
    color: #721c24;
}

.deck-description {
    color: #7f8c8d;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.deck-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 8px;
}

.empty-state p {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

/* Deck View */
.deck-view-container {
    max-width: 900px;
    margin: 0 auto;
}

.deck-header {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.deck-title-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.deck-stats {
    margin: 1rem 0;
    color: #7f8c8d;
}

.stat {
    display: inline-block;
    margin-right: 1.5rem;
}

/* Cards */
.cards-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
}

.cards-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-content-preview {
    flex: 1;
}

.card-front, .card-back {
    margin-bottom: 0.5rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

/* Forms */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
}

.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Study Session */
.study-container {
    max-width: 800px;
    margin: 0 auto;
}

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

.study-header h1 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.due-count {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.flashcard-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.flashcard {
    position: relative;
    min-height: 300px;
}

.flashcard-front, .flashcard-back {
    display: none;
}

.flashcard-front.active, .flashcard-back.active {
    display: block;
}

.flashcard h2 {
    text-align: center;
    color: #3498db;
    margin-bottom: 1.5rem;
}

.card-content {
    font-size: 1.25rem;
    line-height: 1.8;
    padding: 2rem;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flip-button {
    display: block;
    margin: 2rem auto 0;
    padding: 0.75rem 2rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.flip-button:hover {
    background-color: #2980b9;
}

.quality-buttons {
    margin-top: 2rem;
    text-align: center;
}

.quality-buttons h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.quality-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.quality-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.quality-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.quality-number {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.quality-label {
    font-size: 0.875rem;
    color: #7f8c8d;
}

.quality-0 {
    border-color: #c0392b;
}

.quality-0:hover {
    background-color: #fdf0ef;
}

.quality-1 {
    border-color: #e74c3c;
}

.quality-1:hover {
    background-color: #fef5f4;
}

.quality-2 {
    border-color: #f39c12;
}

.quality-2:hover {
    background-color: #fef9f0;
}

.quality-3 {
    border-color: #f1c40f;
}

.quality-3:hover {
    background-color: #fefcf0;
}

.quality-4 {
    border-color: #27ae60;
}

.quality-4:hover {
    background-color: #f0f9f4;
}

.quality-5 {
    border-color: #16a085;
}

.quality-5:hover {
    background-color: #eff9f7;
}

.no-cards {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
}

.no-cards h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.no-cards p {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Study Complete */
.complete-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.complete-header {
    margin-bottom: 2rem;
}

.celebration {
    font-size: 4rem;
    margin: 1rem 0;
}

.stats-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.stat-card {
    padding: 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}
