/**
 * ENSAIntranet - Main Stylesheet
 */

/* ========================================
   RESET AND BASE STYLES
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary Colors (matching eportfolio exactly) */
    --primary-color: #366cb3;
    --secondary-color: #ee7203;
    --tertiary-1: #fab200;
    --tertiary-2: #38bff0;

    /* Status Colors */
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #38bff0;  /* Uses tertiary-2, not Bootstrap default */

    /* Neutral Colors */
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #dee2e6;

    /* Legacy aliases for backward compatibility */
    --color-primary: var(--primary-color);
    --color-secondary: var(--secondary-color);
    --color-tertiary-1: var(--tertiary-1);
    --color-tertiary-2: var(--tertiary-2);
    --color-success: var(--success);
    --color-danger: var(--danger);
    --color-warning: var(--warning);
    --color-info: var(--info);
    --color-light: var(--bg-light);
    --color-text: var(--text-dark);
    --color-border: var(--border-color);
}

body {
    font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 1rem;
}

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

p {
    margin-bottom: 1rem;
}

/* ========================================
   LANDING PAGE STYLES
   ======================================== */

.landing-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-tertiary-2) 100%);
    padding: 20px;
}

.landing-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
}

.landing-header {
    text-align: center;
    margin-bottom: 2rem;
}

.landing-logo {
    margin: 0 auto 1rem;
    text-align: center;
}

.landing-logo img {
    max-width: 200px;
    height: auto;
}

.landing-title {
    color: var(--color-dark);
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
}

.landing-subtitle {
    color: #666;
    font-size: 0.95rem;
}

.landing-content {
    margin-top: 2rem;
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card-header {
    padding: 1.5rem;
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

/* ========================================
   FORMS
   ======================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label,
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(54, 108, 179, 0.1);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    height: 44px;
    padding: 0 24px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background-color: #2c5a94;
    text-decoration: none;
}

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

.btn-secondary:hover {
    background-color: #d46302;
    text-decoration: none;
}

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

.btn-success:hover {
    background-color: #218838;
    text-decoration: none;
}

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

.btn-danger:hover {
    background-color: #c82333;
    text-decoration: none;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

.btn-large {
    width: 100%;
    height: 52px;
    font-size: 1.1rem;
}

.btn-sm {
    height: 36px;
    padding: 0 16px;
    font-size: 0.875rem;
}

button:disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left-color: var(--color-success);
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: var(--color-danger);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left-color: var(--color-warning);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--color-info);
}

/* ========================================
   MAIN LAYOUT
   ======================================== */

.main-content {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   DASHBOARD
   ======================================== */

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.card {
    padding: 25px;
}

.card h3 {
    margin-bottom: 15px;
    color: var(--color-dark);
    font-size: 1.3rem;
}

.card p {
    margin-bottom: 15px;
    color: #666;
}

/* ========================================
   BADGES
   ======================================== */

.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 3px;
    margin-left: 5px;
}

.badge-primary   { background-color: var(--primary-color); color: white; }
.badge-secondary { background-color: var(--secondary-color); color: white; }
.badge-success   { background-color: var(--success); color: white; }
.badge-danger    { background-color: var(--danger); color: white; }
.badge-warning   { background-color: var(--warning); color: #333; }
.badge-info      { background-color: var(--info); color: white; }

/* ========================================
   UTILITIES
   ======================================== */

.text-muted   { color: var(--text-light); }
.text-center  { text-align: center; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

/* Scroll-to-top FAB */
#scroll-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(54,108,179,0.45);
    transition: opacity 0.2s, transform 0.2s;
    z-index: 999;
    line-height: 1;
}
#scroll-fab:hover { opacity: 0.88; transform: translateY(-2px); }

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .landing-title {
        font-size: 1.75rem;
    }

    .landing-logo img {
        max-width: 150px;
    }

    .landing-container {
        padding: 2rem;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}
