/* style.css - Giao diện Dark Mode hiện đại cho Flashcard App */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #121212;
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 30px 20px;
}

.container {
    background: #1e1e1e;
    max-width: 800px;
    width: 100%;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #2a2a2a;
}

/* Header chung */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.main-header h1 {
    color: #ffffff;
    font-size: 1.6rem;
    margin-bottom: 5px;
}

.main-header p {
    color: #9e9e9e;
    font-size: 0.9rem;
}

/* Nút bấm chính & phụ */
.btn-primary {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: #219653;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #2980b9;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 20px;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background: #2471a3;
}

/* Lưới hiển thị danh sách bộ thẻ (Trang chủ) */
.deck-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    text-align: left;
}

.deck-card {
    background: #252525;
    border: 1px solid #333333;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.deck-card:hover {
    transform: translateY(-3px);
    border-color: #3498db;
}

.deck-card h3 {
    color: #ffffff;
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.deck-card p {
    color: #b0b0b0;
    font-size: 0.88rem;
    margin-bottom: 15px;
    flex-grow: 1;
}

.badge {
    display: inline-block;
    background-color: rgba(39, 174, 96, 0.15);
    color: #2ecc71;
    padding: 4px 8px;
    font-size: 0.78rem;
    font-weight: bold;
    border-radius: 4px;
    margin-bottom: 15px;
    width: fit-content;
}

.btn-study {
    display: block;
    width: 100%;
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
}

.btn-study:hover {
    background-color: #2980b9;
}

.empty-msg {
    color: #888;
    font-style: italic;
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
}

/* Form tạo bộ thẻ (Trang create.html) */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #cfcfcf;
    font-size: 0.95rem;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: #2a2a2a;
    border: 1px solid #3d3d3d;
    color: #ffffff;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus, 
.form-group textarea:focus {
    border-color: #3498db;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Các dòng nhập thẻ (Mặt trước / Mặt sau) */
.card-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: center;
    background: #252525;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #333333;
}

.card-input-row input {
    flex: 1;
    padding: 10px;
    background: #1e1e1e;
    border: 1px solid #3d3d3d;
    color: #ffffff;
    border-radius: 6px;
    outline: none;
}

.card-input-row input:focus {
    border-color: #3498db;
}

.btn-remove-card {
    background: #c0392b;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.btn-remove-card:hover {
    background: #e74c3c;
}

/* Thanh hành động dưới form */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 30px;
    border-top: 1px solid #2a2a2a;
    padding-top: 20px;
}

.btn-cancel {
    background: #555555;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.btn-cancel:hover {
    background: #666666;
}

.btn-save {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.btn-save:hover {
    background: #219653;
}

/* Footer */
footer {
    border-top: 1px solid #2a2a2a;
    margin-top: 30px;
    padding-top: 20px;
    font-size: 0.85rem;
    color: #777777;
    text-align: center;
}
/* --- CSS CHO TRANG ÔN TẬP FLASHCARD (study.html) --- */

.study-container {
    text-align: center;
    max-width: 650px;
}

.study-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.study-header h2 {
    font-size: 1.2rem;
    color: #fff;
}

/* Hiệu ứng 3D Flashcard */
.study-main {
    perspective: 1000px;
    margin-bottom: 25px;
}

.flashcard {
    width: 100%;
    height: 280px;
    cursor: pointer;
    background: transparent;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    border-radius: 12px;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    font-size: 1.4rem;
    font-weight: 500;
    border-radius: 12px;
    border: 1px solid #333;
}

.flashcard-front {
    background-color: #22252a;
    color: #ffffff;
}

.flashcard-back {
    background-color: #1b2e23;
    color: #2ecc71;
    transform: rotateY(180deg);
}

.hint-text {
    color: #888;
    font-size: 0.85rem;
    margin-top: 15px;
}

/* Thanh điều hướng dưới trang học */
.study-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #2a2a2a;
    padding-top: 20px;
}

.study-footer button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}