/* Web app specific styles */

/* CSV Operations */
.csv-operations {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.csv-operations-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #4a6741;
    margin-bottom: 12px;
    text-align: center;
}

.csv-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.csv-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95em;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.csv-button.csv-download {
    background: #4a6741;
    color: white;
}

.csv-button.csv-download:hover {
    background: #5a7751;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.csv-button.csv-upload {
    background: #3498db;
    color: white;
}

.csv-button.csv-upload:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.csv-upload-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9em;
    text-align: center;
    display: none;
}

.csv-upload-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.csv-upload-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.csv-upload-status.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.csv-upload-status.loading {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Subject sign-off status */
.subject-signoffs {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.subject-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 0.9em;
}

.subject-name {
    font-weight: 600;
    color: #4a6741;
}

.signed-off {
    color: #27ae60;
    font-weight: bold;
    font-size: 1.2em;
}

.signed-by {
    font-size: 0.8em;
    color: #666;
    font-style: italic;
}

.not-signed-off {
    color: #bbb;
    font-size: 1.2em;
}

/* Sign-off status in week view */
.signoff-status {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.status-badge.signed-off {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.not-signed-off {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.signoff-details {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.error-message {
    font-size: 0.9em;
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 10px;
    margin: 10px 0;
    font-weight: 500;
}

.signoff-button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.signoff-button.apply-signoff {
    background: #28a745;
    color: white;
}

.signoff-button.apply-signoff:hover {
    background: #218838;
}

.signoff-button.revoke-signoff {
    background: #dc3545;
    color: white;
}

.signoff-button.revoke-signoff:hover {
    background: #c82333;
}

.no-permission {
    font-size: 0.9em;
    color: #6c757d;
    font-style: italic;
    margin-top: 10px;
}
.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 15px;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.header {
    text-align: center;
    margin-bottom: 20px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.header h1 {
    color: #4a6741;
    font-size: 2.2em;
    margin-bottom: 8px;
    font-weight: 700;
}

.header p {
    color: #666;
    font-size: 1.2em;
}

/* Main Options Layout */
.main-options {
    display: grid;
    gap: 40px;
}

.option-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.option-section h2 {
    color: #4a6741;
    font-size: 1.8em;
    margin-bottom: 10px;
    text-align: center;
}

.option-section p {
    color: #666;
    font-size: 1.1em;
    text-align: center;
    margin-bottom: 25px;
}

/* Subject Grid */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.subject-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid transparent;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.subject-card.english:hover { border-color: #e74c3c; }
.subject-card.maths:hover { border-color: #3498db; }
.subject-card.geography:hover { border-color: #27ae60; }
.subject-card.science:hover { border-color: #9b59b6; }

.subject-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.subject-card h3 {
    color: #4a6741;
    margin-bottom: 0;
    font-size: 1.5em;
}


/* Year Grid */
.year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.year-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    text-decoration: none;
    color: #4a6741;
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.year-card:hover {
    background: #4a6741;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.year-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.year-card h3 {
    margin-bottom: 5px;
    font-size: 1.2em;
}

.year-card p {
    margin: 0;
    font-size: 0.9em;
    font-weight: normal;
    opacity: 0.8;
}

/* Term Grid */
.term-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.term-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-align: center;
}

.term-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.term-card h3 {
    color: #4a6741;
    margin-bottom: 5px;
}

.term-card p {
    color: #666;
    font-size: 0.9em;
}

.booklet-warning {
    background: #fff3cd;
    color: #856404;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
    margin-top: 10px;
    border: 1px solid #ffeaa7;
    text-align: center;
}

/* Navigation */
.breadcrumb {
    background: white;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.breadcrumb-path {
    display: flex;
    align-items: center;
}

.breadcrumb-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #666;
}

.breadcrumb-user .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #4a6741;
}

.breadcrumb-user .user-name {
    font-weight: 500;
    color: #4a6741;
}

.breadcrumb a {
    color: #4a6741;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 10px;
    color: #999;
}

.breadcrumb .current {
    color: #333;
    font-weight: 600;
}

.info-badge {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    margin-top: 10px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* Week View */
.weeks-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    max-width: 100%;
    margin: 0;
    padding: 0 20px;
}

.week-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.week-header {
    background: #4a6741;
    color: white;
    padding: 15px 20px;
    font-weight: 600;
    text-align: center;
    font-size: 1.1em;
}

.keywords-list {
    width: 100%;
}

.keyword-item {
    padding: 8px 15px;
    border-bottom: 1px solid #eee;
    line-height: 1.4;
}

.keyword-item:last-child {
    border-bottom: none;
}

.keyword-item:hover {
    background-color: #f9f9f9;
}

.keyword-row {
    display: flex;
    align-items: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
}

.keyword-input {
    flex-shrink: 0;
    width: 240px;
    font-weight: 600;
    color: #4a6741;
    margin-right: 5px;
}

.separator {
    flex-shrink: 0;
    color: #666;
    margin: 0 5px;
}

.definition-container {
    flex: 1;
    position: relative;
    min-width: 0;
}

.definition-input {
    width: 100%;
    color: #333;
    flex: 1;
    min-width: 0;
}

/* Editable fields */
.keyword-input,
.definition-input {
    border: none;
    background: transparent;
    font: inherit;
    color: inherit;
    padding: 4px 6px;
    border-radius: 3px;
    transition: all 0.3s ease;
    outline: none;
}

.keyword-input:focus,
.definition-input:focus {
    background: #f0f8ff;
    border: 1px solid #4a6741;
}

.keyword-input:hover,
.definition-input:hover {
    background: #fafafa;
}

/* Character counter */
.char-counter {
    position: absolute;
    bottom: 2px;
    right: 30px;
    font-size: 0.8em;
    color: #666;
    background: rgba(255, 255, 255, 0.9);
    padding: 1px 4px;
    border-radius: 3px;
    pointer-events: none;
    transition: color 0.3s ease;
}


.char-counter.limit {
    color: #e74c3c;
    font-weight: bold;
}

/* Over-limit definition highlighting */
.keyword-item.over-limit {
    background-color: #fdf2f2;
}

.keyword-item.over-limit:hover {
    background-color: #fcebeb;
}

/* Larger text for keywords and definitions */
.keyword-input,
.definition-input {
    font-size: 1.1em;
}

.keyword-item {
    font-size: 1.05em;
}

/* AI Autofill Button */
.ai-autofill-btn {
    position: absolute;
    top: 50%;
    right: 2px;
    transform: translateY(-50%);
    background: #4a6741;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

.ai-autofill-btn:hover {
    background: #5a7751;
    transform: scale(1.1);
}

.ai-autofill-btn:active {
    transform: scale(0.95);
}

.ai-autofill-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Loading state for AI button */
.ai-autofill-btn.htmx-request {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading states */
.htmx-request {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.save-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4a6741;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 0.9em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.save-indicator.show {
    opacity: 1;
}

/* Download Grid */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.download-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid transparent;
}

.download-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #4a6741;
}

.download-card.disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.download-card.disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-color: transparent;
}

.download-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.download-card h3 {
    color: #4a6741;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.download-card.disabled h3 {
    color: #999;
}

.download-card p {
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
}

.download-card.disabled p {
    color: #999;
}

.download-action {
    color: #4a6741;
    font-weight: 600;
    font-size: 0.9em;
}

.unavailable {
    color: #e74c3c !important;
    font-weight: 600;
    font-size: 0.9em;
}

/* Disabled states for term cards */
.term-card.disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.term-card.disabled:hover {
    transform: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.term-card.disabled h3 {
    color: #999;
}

.term-card.disabled p {
    color: #999;
}

/* Section Headers */
.section-header {
    margin: 25px 0 15px 0;
    text-align: center;
}

.section-header h2 {
    color: #4a6741;
    font-size: 1.6em;
    margin-bottom: 8px;
    font-weight: 600;
}

/* Class Grid */
.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.class-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid transparent;
}

.class-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #4a6741;
}

.class-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.class-card h3 {
    color: #4a6741;
    margin-bottom: 10px;
    font-size: 1.3em;
    font-weight: 600;
}

.class-card p {
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* Class Zip Section */
.class-zip-section {
    margin-bottom: 40px;
}

.class-zip-card {
    background: linear-gradient(135deg, #4a6741, #5a7751);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-decoration: none;
    display: block;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.class-zip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #5a7751, #6a8761);
}

.zip-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.class-zip-card h3 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.class-zip-card p {
    color: white;
    line-height: 1.5;
    margin-bottom: 10px;
    opacity: 0.9;
}

.class-zip-card .download-action {
    color: white;
    font-weight: 600;
    font-size: 0.9em;
    opacity: 1;
}

/* Student List */
.student-list {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.student-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.student-item:last-child {
    border-bottom: none;
}

.student-item:hover {
    background-color: #f9f9f9;
}

.student-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.student-icon {
    font-size: 1.2em;
    margin-right: 15px;
    color: #4a6741;
}

.student-name {
    font-weight: 500;
    color: #333;
    font-size: 1.1em;
}

.student-download-btn {
    background: #4a6741;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.student-download-btn:hover {
    background: #5a7751;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.download-icon {
    font-size: 0.8em;
}

/* No classes/students messages */
.no-classes,
.no-students {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    color: #666;
    font-size: 1.1em;
}

/* Authentication Section */
.auth-section {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.google-login-btn {
    display: inline-flex;
    align-items: center;
    background: white;
    color: #757575;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border: 1px solid #dadce0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.google-login-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.user-info span:first-child {
    font-weight: 600;
    color: #4a6741;
    font-size: 1.1em;
}

.user-info span:last-of-type {
    color: #666;
    font-size: 0.9em;
}

.logout-btn {
    background: #dc3545;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 5px;
}

.logout-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Content Section */
.content-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.content-section h2 {
    color: #4a6741;
    font-size: 1.6em;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

/* File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.file-item:hover {
    border-color: #4a6741;
    background: #f0f8ff;
    transform: translateX(5px);
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 1.2em;
    font-weight: 600;
    color: #4a6741;
    margin-bottom: 5px;
}

.file-details {
    font-size: 0.9em;
    color: #666;
}

.btn-download {
    background: #4a6741;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.btn-download:hover {
    background: #5a7751;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Message Box */
.message-box {
    text-align: center;
    padding: 40px 20px;
    border-radius: 10px;
}

.message-box.unavailable {
    background: #fff3cd;
    border: 2px solid #ffeaa7;
}

.message-box h2 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.message-box p {
    color: #856404;
    font-size: 1.1em;
}

/* Class Grid Enhancements */
.class-name {
    font-size: 1.3em;
    font-weight: 600;
    color: #4a6741;
    margin-bottom: 8px;
}

.class-count {
    font-size: 0.95em;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }

    .breadcrumb {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 10px 12px;
        margin-bottom: 12px;
    }

    .breadcrumb-user {
        justify-content: center;
    }

    .header {
        padding: 15px;
        margin-bottom: 15px;
    }

    .header h1 {
        font-size: 1.8em;
        margin-bottom: 6px;
    }

    .section-header {
        margin: 20px 0 12px 0;
    }

    .section-header h2 {
        font-size: 1.4em;
        margin-bottom: 6px;
    }

    .subject-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .download-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .class-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .student-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .student-download-btn {
        align-self: stretch;
        justify-content: center;
    }

    .weeks-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .week-card {
        margin-bottom: 20px;
    }

    .keywords-table td {
        padding: 8px 10px;
        font-size: 0.9em;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 15px;
    }

    .file-info {
        width: 100%;
    }

    .btn-download {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .content-section {
        padding: 20px;
    }

    .content-section h2 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
}
