/**
 * IntraTrax - Corporate Intranet Styles
 * Clean, professional design with dark blue header/footer
 */

:root {
    /* Brand Colors - configurable via admin */
    --primary-color: #1e3a5f;
    --primary-dark: #152a45;
    --primary-light: #2d5a8a;
    --accent-color: #3498db;
    --accent-hover: #2980b9;
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Spacing */
    --header-height: 64px;
    --footer-height: 48px;
    --sidebar-width: 260px;
    
    /* Typography */
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    --font-mono: 'Cascadia Code', 'Fira Code', monospace;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5em;
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-900);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin: 0 0 1em;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white);
    text-decoration: none;
}

.header-logo img {
    height: 36px;
    width: auto;
}

.header-logo:hover {
    color: var(--white);
    opacity: 0.9;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-nav a {
    color: rgba(255, 255, 255, 0.85);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-nav a:hover,
.header-nav a.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user-info {
    text-align: right;
    line-height: 1.3;
}

.header-user-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.header-user-role {
    font-size: 0.75rem;
    opacity: 0.75;
}

.header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    overflow: hidden;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-top: var(--header-height);
    padding: 24px;
    max-width: 1400px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: rgba(255, 255, 255, 0.75);
    padding: 16px 24px;
    text-align: center;
    font-size: 0.85rem;
    margin-top: auto;
}

.footer a {
    color: rgba(255, 255, 255, 0.9);
}

.footer a:hover {
    color: var(--white);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Module Cards (Dashboard) */
.module-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.module-card:hover {
    transform: translateY(-2px);
}

.module-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.module-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-light) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.module-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.module-description {
    color: var(--gray-500);
    font-size: 0.85rem;
    flex: 1;
}

.module-stats {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
    font-size: 0.8rem;
    color: var(--gray-500);
}

.module-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.module-stat strong {
    color: var(--gray-700);
}

/* Grid System */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Calendar */
.calendar-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--primary-color);
    color: var(--white);
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-nav button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.calendar-nav button:hover {
    background: rgba(255, 255, 255, 0.25);
}

.calendar-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day-header {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--gray-500);
    text-transform: uppercase;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.calendar-day {
    min-height: 100px;
    padding: 8px;
    border-right: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
    background: var(--white);
    transition: background 0.2s;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day:hover {
    background: var(--gray-50);
}

.calendar-day.other-month {
    background: var(--gray-50);
    color: var(--gray-400);
}

.calendar-day.today {
    background: rgba(52, 152, 219, 0.1);
}

.calendar-day-number {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.calendar-day.today .calendar-day-number {
    background: var(--accent-color);
    color: var(--white);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-event {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendar-event.type-general { background: var(--info); color: white; }
.calendar-event.type-meeting { background: var(--accent-color); color: white; }
.calendar-event.type-holiday { background: var(--success); color: white; }
.calendar-event.type-deadline { background: var(--danger); color: white; }
.calendar-event.type-training { background: var(--warning); color: white; }

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-control:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.form-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 4px;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check label {
    cursor: pointer;
    font-size: 0.95rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

.btn-primary {
    background: var(--accent-color);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    color: var(--white);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-300);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover:not(:disabled) {
    background: #0d9668;
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover:not(:disabled) {
    background: var(--gray-100);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
}

.btn-block {
    width: 100%;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-primary { background: rgba(52, 152, 219, 0.15); color: var(--accent-color); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: var(--info); }

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #065f46;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #92400e;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #991b1b;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #1e40af;
}

/* News Items */
.news-item {
    padding: 20px;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.2s;
}

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

.news-item:hover {
    background: var(--gray-50);
}

.news-item.pinned {
    background: rgba(245, 158, 11, 0.05);
    border-left: 3px solid var(--warning);
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.news-category {
    background: var(--gray-200);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.news-title a {
    color: inherit;
}

.news-title a:hover {
    color: var(--accent-color);
}

.news-excerpt {
    color: var(--gray-600);
    margin-bottom: 12px;
    line-height: 1.5;
}

.news-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.news-action {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--gray-500);
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s;
}

.news-action:hover {
    color: var(--accent-color);
}

.news-action.liked {
    color: var(--danger);
}

/* Staff Directory */
.staff-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.staff-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-light));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.staff-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.staff-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
}

.staff-title {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.staff-contact {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.staff-contact a {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Document List */
.document-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.2s;
}

.document-item:hover {
    background: var(--gray-50);
}

.document-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--gray-500);
}

.document-icon.pdf { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.document-icon.doc { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.document-icon.xls { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.document-icon.img { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

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

.document-name {
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-meta {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* Setup Wizard */
.setup-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 24px;
}

.setup-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    overflow: hidden;
}

.setup-header {
    padding: 32px;
    text-align: center;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.setup-logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.setup-subtitle {
    color: var(--gray-500);
}

.setup-body {
    padding: 32px;
}

.setup-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.setup-step {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray-200);
    transition: all 0.3s;
}

.setup-step.active {
    background: var(--accent-color);
    transform: scale(1.2);
}

.setup-step.completed {
    background: var(--success);
}

.setup-footer {
    padding: 20px 32px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 24px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.login-header {
    padding: 32px;
    text-align: center;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.login-logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.login-body {
    padding: 32px;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 8px 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--gray-700);
    font-size: 0.9rem;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 8px 0;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.hidden { display: none; }

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 0 16px;
    }
    
    .header-nav {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 4px;
    }
    
    .calendar-day-header {
        padding: 8px 4px;
        font-size: 0.7rem;
    }
    
    .staff-card {
        flex-direction: column;
        text-align: center;
    }
    
    .staff-contact {
        flex-direction: column;
        gap: 8px;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}

