@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');

/* Global Design System - Identidade Visual Oficial Instituto Federal (Manual 2015) */
:root {
    --primary: #2f9e41; /* Verde IF oficial (RGB 50, 160, 65 | Pantone 362 C) */
    --primary-hover: #258235;
    --secondary: #cd191e; /* Vermelho IF oficial (RGB 200, 25, 30 | Pantone 187 C) */
    --secondary-hover: #ab1418;
    --accent: #cd191e;
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --surface-light: #ffffff;
    --surface-dark: #1e293b;
    --text-light: #1e293b;
    --text-dark: #f8fafc;
    --border-light: #f1f5f9;
    --border-dark: #334155;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

/* Glassmorphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass {
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Card Style */
.card {
    background-color: var(--surface-light);
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark .card {
    background-color: var(--surface-dark);
    border-color: var(--border-dark);
}

.card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #d1fae5;
}

.dark .card:hover {
    border-color: rgba(16, 185, 129, 0.2);
}

/* Loader Animation */
.loader {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid #e2e8f0;
    border-top-color: var(--primary);
    border-right-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

.dark .loader {
    border-color: #334155;
    border-top-color: var(--primary);
    border-right-color: var(--primary);
}

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

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: #e2e8f0;
    border-radius: 9999px;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: #334155;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: #cbd5e1;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: #475569;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #1e293b;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    transition: all 0.2s;
}

.dark .btn-secondary {
    background-color: var(--primary);
}

.btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Print Styles */
@media print {
    body > *:not(.print-content) {
        display: none !important;
    }
    
    .print-content {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }

    .print-hide {
        display: none !important;
    }
    
    .break-after-page {
        page-break-after: always;
    }
}

/* --- Dark Mode Contrast Improvements --- */
.dark input[type="text"],
.dark input[type="date"],
.dark input[type="time"],
.dark input[type="email"],
.dark input[type="number"],
.dark input[type="password"],
.dark select,
.dark textarea {
    background-color: #0f172a !important; /* slate-900 */
    border-color: #475569 !important; /* slate-600 */
    color: #f8fafc !important; /* slate-50 */
}

.dark input::placeholder,
.dark textarea::placeholder {
    color: #94a3b8 !important; /* slate-400 */
}

.dark label {
    color: #cbd5e1 !important; /* slate-300 */
}

.dark .card,
.dark .bg-slate-800 {
    background-color: #1e293b !important; /* Ensure cards are distinctly slate-800 */
    border-color: #334155 !important; /* slate-700 */
}

.dark .bg-slate-900 {
    background-color: #0f172a !important; /* Ensure deep background */
}

/* Calendar Cells Contrast */
.dark .js-day-cell {
    border-color: #475569 !important; /* slate-600 for better visibility */
    background-color: rgba(30, 41, 59, 0.4); /* slight slate-800 tint to differentiate from background */
}
/* Ensure available days are white in dark mode */
.dark .js-day-cell:not(.cursor-not-allowed) {
    color: white !important;
}
.dark .js-day-cell:hover:not(.cursor-not-allowed) {
    background-color: rgba(16, 185, 129, 0.2) !important; /* emerald-500 tint */
}

/* Invert native date/time icons in dark mode */
.dark input[type="date"]::-webkit-calendar-picker-indicator,
.dark input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.8; /* Slight opacity so it's not blindingly white */
}
