/* ----- Global & Dashboard Styles (Tiny5 / Dark Theme) ----- */
@import url('https://fonts.googleapis.com/css2?family=Gulzar&display=swap');

.dashboard-body {
    background-color: #FFFFFF;
    color: #000000;
    font-family: "Gulzar", serif;
}

.dashboard-body a {
    color: #000000;
}

.dashboard-main {
    max-width: 800px;
    margin: 0 auto;
    text-align: start;
    padding: 20px;
}

.upload-section,
.library-section {
    border: 2px solid #000000;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 8px;
    font-family: "Gulzar", serif;
    font-size: 1rem;
    background-color: #FFFFFF;
    color: #000000;
    border: 1px solid #000000;
    border-radius: 5px;
}

.primary-btn {
    background-color: #000000;
    color: #FFFFFF;
    font-family: "Gulzar", serif;
    font-size: 1.2rem;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

.primary-btn:hover {
    background-color: #00cc00;
}

.secondary-btn {
    background-color: transparent;
    color: #ff3333;
    font-family: "Gulzar", serif;
    font-size: 1rem;
    padding: 5px 10px;
    border: 1px solid #ff3333;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
}

.secondary-btn:hover {
    background-color: #ff3333;
    color: #000;
}

.status-msg {
    margin-top: 10px;
    font-size: 1.1rem;
}

/* Library Folder styling */
.subject-folder {
    margin-bottom: 20px;
    border: 1px dashed #000000;
    padding: 10px;
    border-radius: 8px;
}

.subject-title {
    font-size: 1.5rem;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.year-folder {
    margin-left: 20px;
    margin-bottom: 10px;
}

.year-title {
    font-size: 1.2rem;
    margin: 5px 0;
    color: #555555;
}

.exercise-list {
    margin-left: 20px;
    list-style-type: square;
}

.exercise-link {
    text-decoration: none;
    font-size: 1.1rem;
}

.exercise-link:hover {
    text-decoration: underline;
}

/* ----- Flashcard Viewer Styles (Clean, Light Theme) ----- */

.viewer-body {
    background-color: #f8f9fa;
    color: #333;
    font-family: 'Gulzar', serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.viewer-header {
    width: 100%;
    max-width: 600px;
    margin-bottom: 30px;
}

.selector-dropdown {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background-color: #ffffff;
    color: #333;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 20px top 50%;
    background-size: 12px auto;
}

.flashcard-container {
    perspective: 1000px;
    width: 100%;
    max-width: 600px;
    height: 400px;
    margin-bottom: 30px;
}

.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
    cursor: pointer;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    box-sizing: border-box;
}

.flashcard-back {
    transform: rotateY(180deg);
}

.card-subject {
    position: absolute;
    top: 30px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #8b8bf5;
    text-transform: uppercase;
}

.card-image-container {
    max-height: 150px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image {
    max-height: 100%;
    max-width: 100%;
    border-radius: 8px;
    object-fit: contain;
}

.card-content {
    font-size: 4rem;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    word-break: break-word;
}

.card-content.long-text {
    font-size: 2.5rem;
}

.card-instruction {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.95rem;
    color: #9aa0a6;
    font-weight: 400;
}

/* Viewer Controls */
.viewer-controls {
    width: 100%;
    max-width: 600px;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1rem;
    color: #5f6368;
    font-weight: 600;
}

.status-actions {
    display: flex;
    gap: 15px;
}

.action-btn {
    background: none;
    border: none;
    color: #5f6368;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.action-btn:hover {
    color: #1a1a2e;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.nav-btn {
    flex: 1;
    padding: 16px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-prev {
    background-color: #ffffff;
    color: #1a1a2e;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.btn-prev:hover {
    background-color: #f1f3f4;
}

.btn-next {
    background-color: #5c5cf4;
    color: #ffffff;
    border: 1px solid #5c5cf4;
    box-shadow: 0 4px 12px rgba(92, 92, 244, 0.3);
}

.btn-next:hover {
    background-color: #4b4be2;
}

.btn-next:disabled,
.btn-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #e0e0e0;
    color: #9aa0a6;
    border-color: #e0e0e0;
    box-shadow: none;
}

.back-link {
    margin-top: 40px;
    color: #5f6368;
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}