/*
 * Copyright (c) 2026 Dr. Red Oy. All rights reserved.
 * CONFIDENTIAL AND PROPRIETARY
 *
 * This file is part of Gnossio Vector - AI-Powered Learning Assessment.
 * Unauthorized copying, distribution, or use of this file, via any medium,
 * is strictly prohibited without prior written consent from Dr. Red Oy.
 */

/**
 * Gnossio Core CSS
 * Shared styles for both teachers and students
 */

/* ========================================
   CSS Custom Properties (Brand Colors)
   ======================================== */
:root {
    --brand-red: #b03a2e;
    --brand-red-dark: #8e2f25;
    --brand-red-light: #c85a4f;
    --brand-gray: #6b7280;
    --brand-gray-light: #f3f4f6;

    /* Typography */
    --font-display: 'Raleway', 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
}

/* ========================================
   Global Typography
   ======================================== */
body {
    font-family: var(--font-body);
}

h1, h2 {
    font-family: var(--font-display);
}

/* ========================================
   Brand Utility Classes
   ======================================== */
.brand-color { color: var(--brand-red); }
.brand-bg { background-color: var(--brand-red); }
.brand-border { border-color: var(--brand-red); }
.brand-hover:hover {
    background-color: var(--brand-red-dark);
    border-color: var(--brand-red-dark);
}

.btn-brand-outline {
    background-color: white;
    color: var(--brand-red);
    border: 1px solid var(--brand-red);
    transition: all 0.2s ease;
}

.btn-brand-outline:hover {
    background-color: #fdf2f2;
}

.input-brand-focus:focus {
    box-shadow: 0 0 0 2px var(--brand-red);
    border-color: var(--brand-red);
}

/* ========================================
   Button System
   ======================================== */
.btn-base {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
}

.btn-base:focus {
    outline: none;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--brand-red);
}

.btn-base:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary,
.btn-brand {
    background-color: var(--brand-red);
    color: white;
    border-color: var(--brand-red);
}

.btn-primary:hover,
.btn-brand:hover {
    background-color: var(--brand-red-dark);
    border-color: var(--brand-red-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(176, 58, 46, 0.3);
}

.btn-primary:disabled,
.btn-brand:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: white;
    color: #374151;
    border-color: #d1d5db;
}

.btn-secondary:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.btn-danger {
    background-color: white;
    color: var(--brand-red);
    border-color: var(--brand-red);
}

.btn-danger:hover {
    background-color: #fdf2f2;
    border-color: var(--brand-red-dark);
    color: var(--brand-red-dark);
}

.btn-ghost {
    background-color: transparent;
    color: #4b5563;
    border-color: transparent;
}

.btn-ghost:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

/* Size Variants */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* ========================================
   Link Styles
   ======================================== */
.link-brand {
    color: var(--brand-red);
    transition: color 0.2s ease;
}

.link-brand:hover {
    color: var(--brand-red-dark);
    text-decoration: underline;
}

/* ========================================
   Info Field Labels
   ======================================== */
.field-label {
    font-weight: 600;
}

/* ========================================
   Form Field Validation
   ======================================== */
.field-error input,
.field-error select,
.field-error textarea {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px #dc2626;
}

.field-error input:focus,
.field-error select:focus,
.field-error textarea:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.3);
}

.field-error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ========================================
   Card Hover Effects
   ======================================== */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Tab Navigation
   ======================================== */
.tab-bar {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0;
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.tab-btn:hover:not(.tab-disabled) {
    color: #374151;
}

.tab-btn:focus-visible {
    outline: 2px solid var(--brand-red);
    outline-offset: -2px;
    border-radius: 0.25rem 0.25rem 0 0;
}

.tab-btn.tab-active {
    color: var(--brand-red);
    border-bottom-color: var(--brand-red);
    font-weight: 600;
}

.tab-btn.tab-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========================================
   Navigation Styles
   ======================================== */
.nav-link {
    position: relative;
    transition: all 0.2s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--brand-red);
    transition: width 0.2s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* ========================================
   Mobile Navigation Drawer
   ======================================== */
.mobile-drawer-backdrop {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-drawer-overlay.open .mobile-drawer-backdrop {
    opacity: 1;
}

.mobile-drawer-panel {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.mobile-drawer-overlay.open .mobile-drawer-panel {
    transform: translateX(0);
}

/* ========================================
   Breadcrumb Overflow (mobile)
   ======================================== */
@media (max-width: 640px) {
    nav.flex.text-sm {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

/* ========================================
   Message Alerts
   ======================================== */
.message-alert {
    transition: opacity 0.5s ease;
}

/* ========================================
   Toast Notifications
   ======================================== */
#gnossio-toast {
    transition: opacity 0.5s ease;
}

/* ========================================
   Confirmation Modal
   ======================================== */
.confirm-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.confirm-backdrop.hidden {
    display: none;
}

.confirm-backdrop.open {
    opacity: 1;
}

.confirm-dialog {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 28rem;
    width: calc(100% - 2rem);
    padding: 1.5rem;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.confirm-backdrop.open .confirm-dialog {
    transform: scale(1);
}

/* ========================================
   Landing Page Styles
   ======================================== */
.gradient-bg {
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 50%, #fef5f5 100%);
}

.fade-in {
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-glow {
    filter: drop-shadow(0 0 20px rgba(176, 58, 46, 0.1));
}

/* ========================================
   Card Entrance Animations
   ======================================== */
.card-animate {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.card-animate.card-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Accessibility: Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .card-animate {
        opacity: 1;
        transform: none;
    }
}
