/* v4.2: Custom CSS - Extracted from index.html */

/* v4.2fix: Prevent flash of uncompiled Vue templates (v-cloak) */
[v-cloak] { display: none !important; }

/* ===== CSS Custom Properties ===== */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #f8fafc;
    --dark-text: #1e293b;
    --light-text: #64748b;
    --border-color: #e2e8f0;
}

/* ===== Base Styles ===== */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    margin: 0;
    padding: 0;
}

.big-screen-card { font-size: 1.5rem; }

/* ===== Vue Transition Classes ===== */
.fade-enter-active, .fade-leave-active { transition: opacity 0.5s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* ===== Card Styles ===== */
.card-hover { 
    transition: all 0.3s ease;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.card-hover:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color);
}

/* ===== Button Styles ===== */
.btn-primary { 
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    font-weight: 600;
}

.btn-primary:hover { 
    transform: translateY(-1px); 
    box-shadow: 0 6px 12px -4px rgba(0, 0, 0, 0.15), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

/* ===== Tab Styles ===== */
.tab-active { 
    transition: all 0.3s ease;
}

/* ===== Form Styles ===== */
.form-input {
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===== Navigation Styles ===== */
.nav-link {
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

.nav-link:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

/* ===== Responsive Media Queries ===== */
@media (max-width: 640px) {
    .container { padding-left: 1rem; padding-right: 1rem; }
    .nav-tabs { flex-direction: column; align-items: stretch; }
    .nav-tabs button { margin-bottom: 0.5rem; text-align: center; }
    .grid-cols-2, .grid-cols-3 { grid-template-columns: 1fr; }
}

@media (min-width: 640px) and (max-width: 1024px) {
    .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Calendar Date Highlighting (overrides Flatpickr defaults) ===== */
/* Note: !important is required here to override third-party Flatpickr library styles */
.date-with-questions {
    border: 2px solid #ff6b6b !important;
    background-color: #fff5f5 !important;
}

.date-with-assignments {
    border: 2px solid #4ecdc4 !important;
    background-color: #f0fffe !important;
}

.date-with-both {
    border: 2px solid #ff6b6b !important;
    background: linear-gradient(135deg, #fff5f5 50%, #f0fffe 50%) !important;
}

/* Calendar input date color indicators */
input[type="date"] {
    position: relative;
    transition: all 0.3s ease;
}

input[type="date"].date-with-questions::-webkit-calendar-picker-indicator,
input[type="date"].date-with-assignments::-webkit-calendar-picker-indicator,
input[type="date"].date-with-both::-webkit-calendar-picker-indicator {
    filter: hue-rotate(180deg) saturate(2);
    transform: scale(1.2);
}

input[type="date"].date-with-questions {
    color: #ff6b6b !important;
    font-weight: bold !important;
}

input[type="date"].date-with-assignments {
    color: #4ecdc4 !important;
    font-weight: bold !important;
}

input[type="date"].date-with-both {
    color: #ff6b6b !important;
    font-weight: bold !important;
}

/* Flatpickr custom styles */
.flatpickr-day.has-questions {
    background-color: #fff5f5 !important;
    border: 2px solid #ff6b6b !important;
    color: #ff6b6b !important;
    font-weight: bold !important;
}

.flatpickr-day.has-assignments {
    background-color: #f0fffe !important;
    border: 2px solid #4ecdc4 !important;
    color: #4ecdc4 !important;
    font-weight: bold !important;
}

.flatpickr-day.has-both {
    background: linear-gradient(135deg, #fff5f5 50%, #f0fffe 50%) !important;
    border: 2px solid #ff6b6b !important;
    color: #ff6b6b !important;
    font-weight: bold !important;
}

.flatpickr-day.today {
    border: 2px solid var(--primary-color) !important;
}

/* Calendar badge indicators */
.calendar-badge {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: 4px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.badge-questions { 
    background-color: #ff6b6b; 
    box-shadow: 0 0 8px #ff6b6b;
}

.badge-assignments { 
    background-color: #4ecdc4; 
    box-shadow: 0 0 8px #4ecdc4;
}

.badge-both { 
    background: linear-gradient(135deg, #ff6b6b 50%, #4ecdc4 50%);
    box-shadow: 0 0 8px rgba(255,107,107,0.5), 0 0 8px rgba(78,205,196,0.5);
}

/* ===== Word Document Preview Styles ===== */
.word-preview-content {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

.word-preview-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
    border: 1px solid #ddd;
}

.word-preview-content th,
.word-preview-content td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.word-preview-content th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.word-preview-content tr:nth-child(even) {
    background-color: #fafafa;
}

.word-preview-content h1 {
    font-size: 1.5em;
    font-weight: bold;
    margin: 20px 0 10px 0;
    color: #333;
}

.word-preview-content h2 {
    font-size: 1.3em;
    font-weight: bold;
    margin: 18px 0 9px 0;
    color: #444;
}

.word-preview-content h3 {
    font-size: 1.1em;
    font-weight: bold;
    margin: 16px 0 8px 0;
    color: #555;
}

.word-preview-content p {
    margin: 8px 0;
}

.word-preview-content ul,
.word-preview-content ol {
    margin: 10px 0;
    padding-left: 30px;
}

.word-preview-content li {
    margin: 5px 0;
}

.word-preview-content strong {
    font-weight: bold;
}

.word-preview-content em {
    font-style: italic;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.animate-fadeIn {
    animation: fadeIn 0.25s ease-out;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.animate-bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===== Line Clamp Utilities ===== */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    line-clamp: 1;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
}

.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    line-clamp: 4;
    overflow: hidden;
}

.aspect-\[4\/3\] {
    aspect-ratio: 4 / 3;
}

/* ===== Toast Notification System ===== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
    width: auto;
}

.toast-item {
    display: flex;
    align-items: flex-start;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    background: white;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.08);
    animation: toastSlideIn 0.3s ease-out;
    transition: all 0.3s ease;
    gap: 0.625rem;
    min-width: 280px;
}

.toast-item.toast-removing {
    opacity: 0;
    transform: translateX(100%);
}

.toast-item.toast-success { border-left: 4px solid #10b981; }
.toast-item.toast-error   { border-left: 4px solid #ef4444; }
.toast-item.toast-warning { border-left: 4px solid #f59e0b; }
.toast-item.toast-info    { border-left: 4px solid #3b82f6; }

.toast-icon { font-size: 1.175rem; flex-shrink: 0; margin-top: 0.075rem; }
.toast-message { flex: 1; font-size: 0.875rem; color: #1e293b; line-height: 1.4; word-break: break-word; }

.toast-close {
    background: none; border: none; cursor: pointer; padding: 0; color: #94a3b8;
    font-size: 1rem; line-height: 1; flex-shrink: 0; transition: color 0.2s;
}

.toast-close:hover { color: #475569; }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}
