/*
 * Fire District Employee Portal Styles v3.0.0 (Production Ready)
 *
 * - Finalized styles for a cohesive, modern, and secure user experience.
 * - All variables and components are production-ready.
 */

/* Google Font Import */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600&display=swap');

/* * ================================================
 * CSS Custom Properties (Variables) for Theming
 * ================================================
 */
:root {
    /* Color Palette */
    --primary-color: #d9534f; /* Fire-engine red */
    --primary-color-dark: #c9302c; /* Darker red */
    --secondary-color: #2c3e50; /* Charcoal */
    --accent-color: #3498db; /* A cool blue for contrast */
    --text-color-light: #ecf0f1; /* Light gray */
    --text-color-dark: #333;
    --text-color-muted: #6c757d;
    --bg-color-light: #ffffff;
    --bg-color-medium: #f8f9fa;
    --bg-color-dark: #f0f2f5;
    --border-color: #dee2e6;

    /* Status Colors */
    --status-active-bg: #e8f5e9;
    --status-active-text: #2e7d32;
    --status-expiring-bg: #fffde7;
    --status-expiring-text: #f9a825;
    --status-expired-bg: #ffebee;
    --status-expired-text: #c62828;

    /* Gradient Palette */
    --gradient-primary: linear-gradient(45deg, #d9534f, #e74c3c);
    --gradient-header: linear-gradient(90deg, #2c3e50, #34495e);
    --gradient-background: linear-gradient(270deg, #e7f0ff, #f8f2f2, #fff0f0);

    /* Typography */
    --font-family-sans: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-family-headings: 'Poppins', var(--font-family-sans);

    /* UI Elements */
    --border-radius-small: 6px;
    --border-radius-large: 10px;
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.1);
    --shadow-hard: 0 2px 4px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: all 0.2s ease-in-out;
    --transition-smooth: all 0.3s ease-in-out;
}

/* * ================================================
 * Keyframe Animations
 * ================================================
 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes backgroundPan {
	0% { background-position: 0% center; }
	100% { background-position: 200% center; }
}

/* * ================================================
 * General Portal Styles & Animated Background
 * ================================================
 */
body.page-template-default {
    background: var(--gradient-background);
    background-size: 200% 200%;
    animation: backgroundPan 25s linear infinite;
}
.fdep-login-container, .fdep-portal-container {
    margin: 0 auto;
    padding: 0;
    font-family: var(--font-family-sans);
    position: relative;
    z-index: 1;
    animation: fadeIn 0.5s ease-in-out;
}

/* * ================================================
 * Modern Login Form
 * ================================================
 */
.fdep-login-container {
    max-width: 420px;
    margin: 50px auto;
    padding: 40px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-medium);
    border-radius: var(--border-radius-large);
}
.fdep-login-form h3 {
    text-align: center;
    font-family: var(--font-family-headings);
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--text-color-dark);
}
.fdep-login-form h3 .fa-solid {
    color: var(--primary-color);
    margin-right: 10px;
}
.fdep-form-group {
    margin-bottom: 20px;
}
.fdep-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color-muted);
}
.fdep-form-group input[type="text"],
.fdep-form-group input[type="password"] {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    box-sizing: border-box;
    transition: var(--transition-smooth);
    background-color: #fff;
}
.fdep-form-group input[type="text"]:focus,
.fdep-form-group input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.15);
}
.fdep-form-group button {
    width: 100%;
    padding: 14px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: var(--transition-smooth);
    letter-spacing: 0.5px;
}
.fdep-form-group button:hover {
    box-shadow: 0 5px 15px rgba(217, 83, 79, 0.3);
    transform: translateY(-2px);
}
#fdep-login-message .error {
    color: var(--status-expired-text);
    background: var(--status-expired-bg);
    border: 1px solid var(--primary-color-dark);
    padding: 12px;
    border-radius: var(--border-radius-small);
    margin-top: 15px;
    text-align: center;
}

/* * ================================================
 * Modern Dashboard Header
 * ================================================
 */
.fdep-header {
    background: var(--gradient-header);
    color: var(--text-color-light);
    padding: 20px 0;
    margin-bottom: 40px;
    box-shadow: var(--shadow-hard);
}
.fdep-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.fdep-header h1 { 
    margin: 0; 
    font-family: var(--font-family-headings);
    font-size: 28px; 
    font-weight: 600; 
}
.fdep-user-info { text-align: right; }
.fdep-user-info span { margin-right: 20px; font-size: 15px; opacity: 0.9; }
#fdep-logout {
    color: #fff;
    text-decoration: none;
    background-color: rgba(255,255,255,0.1);
    padding: 10px 18px;
    border-radius: var(--border-radius-small);
    border: 1px solid rgba(255,255,255,0.2);
    transition: var(--transition-fast);
}
#fdep-logout:hover {
    background-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}
#fdep-logout .fa-solid {
    margin-left: 8px;
}

/* * ================================================
 * Modern Dashboard Grid & Section Cards
 * ================================================
 */
.fdep-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px 40px;
}

.fdep-section {
    background: var(--bg-color-light);
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
    animation: slideUp 0.6s ease-out;
}
.fdep-section:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}
.fdep-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    font-family: var(--font-family-headings);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color-dark);
    display: flex;
    align-items: center;
}
.fdep-icon {
    margin-right: 15px;
    font-size: 22px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

/* * ================================================
 * Enhanced Widgets
 * ================================================
 */

/* Announcements */
.fdep-announcement {
    padding: 15px;
    margin-bottom: 12px;
    border-left-width: 5px;
    border-left-style: solid;
    border-radius: var(--border-radius-small);
    background-color: var(--bg-color-medium);
}
.fdep-announcement h4 { margin: 0 0 5px; font-size: 16px; font-weight: 700; }
.fdep-announcement p { margin: 0 0 8px; font-size: 14px; color: var(--text-color-muted); }
.fdep-announcement small { color: #777; font-size: 12px; }
.fdep-priority-low { border-left-color: #5bc0de; }
.fdep-priority-normal { border-left-color: var(--accent-color); }
.fdep-priority-high { border-left-color: #f0ad4e; }
.fdep-priority-urgent { border-image: linear-gradient(#d9534f, #e74c3c) 1; }

/* Assignments Widget */
.fdep-assignment-item {
    border-bottom: 1px solid #eee;
    padding: 12px 5px;
    margin-bottom: 12px;
}
.fdep-assignment-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.fdep-assignment-item h4 { margin: 0 0 5px; font-size: 16px; color: var(--secondary-color); font-weight: 700; }
.fdep-assignment-item p { margin: 0 0 4px; font-size: 14px; color: var(--text-color-muted); }
.fdep-assignment-item .fa-solid, .fdep-assignment-item .fa-regular { margin-right: 8px; color: var(--text-color-muted); }

/* Quick Links */
.fdep-quick-links { display: flex; flex-direction: column; gap: 12px; }
.fdep-link {
    display: block;
    padding: 16px;
    background: transparent;
    color: var(--primary-color);
    text-decoration: none;
    text-align: center;
    border-radius: var(--border-radius-small);
    border: 1px solid var(--primary-color);
    font-weight: bold;
    transition: var(--transition-fast);
}
.fdep-link:hover {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Certification Status Widget */
.fdep-certification {
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: var(--border-radius-small);
    border: 1px solid;
    font-size: 14px;
}
.fdep-cert-active { background-color: var(--status-active-bg); border-color: #c8e6c9; color: var(--status-active-text); }
.fdep-cert-warning { background-color: var(--status-expiring-bg); border-color: #fff59d; color: var(--status-expiring-text); }
.fdep-cert-expired { background-color: var(--status-expired-bg); border-color: #ffcdd2; color: var(--status-expired-text); }
.fdep-certification strong { font-weight: 700; }
.fdep-certification small { display: block; margin-top: 4px; opacity: 0.9; }

/* * ================================================
 * Modern Modal (General)
 * ================================================
 */
.fdep-modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background-color: rgba(44, 62, 80, 0.7);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}
.fdep-modal-content {
    background-color: var(--bg-color-dark);
    margin: 3% auto;
    padding: 30px 40px;
    border: none;
    width: 95%;
    max-width: 1200px;
    border-radius: var(--border-radius-large);
    position: relative;
    box-shadow: var(--shadow-medium);
    animation: slideUp 0.4s ease-out;
}
.fdep-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}
.fdep-modal-header h3 {
    font-family: var(--font-family-headings);
    font-size: 24px;
    color: var(--secondary-color);
    margin: 0;
}
.fdep-modal-header .fa-solid {
    margin-right: 15px;
    color: var(--primary-color);
}
.fdep-close-modal {
    color: #aaa;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-smooth);
    line-height: 1;
}
.fdep-close-modal:hover,
.fdep-close-modal:focus {
    color: var(--primary-color);
    transform: rotate(90deg);
}
.fdep-modal-body .fdep-loading {
    text-align: center;
    padding: 50px;
    font-size: 20px;
    color: var(--text-color-muted);
}
.fdep-modal-body .fdep-loading .fa-spinner {
    font-size: 3em;
    margin-bottom: 0.5em;
}

/* * ================================================
 * Modal Content - Training Records
 * ================================================
 */
.fdep-cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}
.fdep-cert-card {
    background: var(--bg-color-light);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}
.fdep-cert-card:hover {
     transform: translateY(-5px);
     box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.fdep-cert-card-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}
.fdep-cert-card-header .fa-solid {
    font-size: 24px;
    color: var(--primary-color);
    margin-right: 15px;
    width: 30px;
    text-align: center;
}
.fdep-cert-card-header h4 {
    margin: 0;
    font-size: 18px;
    font-family: var(--font-family-headings);
    font-weight: 600;
    color: var(--secondary-color);
}
.fdep-cert-card-body {
    padding: 20px;
    flex-grow: 1;
}
.fdep-cert-card-body p {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--text-color-muted);
}
.fdep-cert-card-body p strong {
    color: var(--text-color-dark);
    font-weight: 500;
}
.fdep-cert-card-footer {
    padding: 15px 20px;
    background: var(--bg-color-medium);
    border-top: 1px solid var(--border-color);
    border-bottom-left-radius: var(--border-radius-large);
    border-bottom-right-radius: var(--border-radius-large);
    text-align: center;
}
.status-tag {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px; /* pill shape */
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-tag.active { background-color: var(--status-active-bg); color: var(--status-active-text); }
.status-tag.expiring { background-color: var(--status-expiring-bg); color: var(--status-expiring-text); }
.status-tag.expired { background-color: var(--status-expired-bg); color: var(--status-expired-text); }


/* * ================================================
 * Modal Content - Member Roster
 * ================================================
 */
.fdep-roster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}
.fdep-member-card {
    background: var(--bg-color-light);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-soft);
    border-left: 5px solid; /* Rank indicator */
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}
.fdep-member-card:hover {
     transform: translateY(-5px);
     box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
/* Color coding ranks */
.fdep-member-card.rank-chief { border-color: #d4af37; /* Gold */ }
.fdep-member-card.rank-captain { border-color: #c0c0c0; /* Silver */ }
.fdep-member-card.rank-firefighter { border-color: var(--primary-color); }
.fdep-member-card.rank-chief .rank-icon { color: #d4af37; }
.fdep-member-card.rank-captain .rank-icon { color: #8492a6; }
.fdep-member-card.rank-firefighter .rank-icon { color: var(--primary-color); }

.fdep-member-card-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}
.fdep-member-card-header .rank-icon {
    font-size: 36px;
    margin-bottom: 10px;
}
.fdep-member-card-header h4 {
    margin: 0 0 5px;
    font-size: 20px;
    font-family: var(--font-family-headings);
    color: var(--secondary-color);
}
.fdep-member-card-header p {
    margin: 0;
    font-size: 14px;
    color: var(--text-color-muted);
    font-weight: 500;
}
.fdep-member-card-info {
    padding: 15px 20px;
    flex-grow: 1;
}
.fdep-member-card-info p {
    margin: 0 0 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
}
.fdep-member-card-info .fa-solid {
    margin-right: 10px;
    color: var(--text-color-muted);
    width: 20px;
    text-align: center;
}
.fdep-member-certs {
     padding: 15px 20px;
     border-top: 1px solid var(--border-color);
}
.fdep-member-certs h5 {
    margin: 0 0 10px;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-color-muted);
    font-weight: 700;
}
.fdep-member-certs .cert-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cert-tag {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: var(--border-radius-small);
    font-size: 12px;
    font-weight: 500;
}
.cert-tag.emt {
     background: var(--accent-color);
}

/* * ================================================
 * Modal Content - Document Library
 * ================================================
 */
.fdep-doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.fdep-doc-category-title {
    grid-column: 1 / -1;
    margin: 10px 0 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    font-size: 18px;
    font-family: var(--font-family-headings);
    color: var(--primary-color);
}
.fdep-document-item a {
    display: flex;
    align-items: center;
    background: var(--bg-color-light);
    padding: 20px;
    border-radius: var(--border-radius-small);
    border: 1px solid #e5e5e5;
    text-decoration: none;
    height: 100%;
    transition: var(--transition-fast);
}
.fdep-document-item a:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-soft);
    border-color: var(--primary-color);
}
.fdep-document-item .fa-solid {
    font-size: 28px;
    color: var(--secondary-color);
    margin-right: 20px;
}
.fdep-document-item h5 {
    margin: 0 0 5px;
    color: var(--secondary-color);
    font-size: 16px;
}
.fdep-document-item p {
    margin: 0;
    font-size: 13px;
    color: var(--text-color-muted);
}


/* * ================================================
 * Modal Content - All Assignments
 * ================================================
 */
.fdep-modal-assignment-item {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-large);
    margin-bottom: 15px;
    background-color: var(--bg-color-light);
    transition: var(--transition-fast);
}
.fdep-modal-assignment-item:hover {
    border-color: var(--accent-color);
}
.fdep-modal-assignment-item h4 {
    margin-top: 0;
    font-family: var(--font-family-headings);
    font-size: 18px;
}
