/* RKU Leads Dashboard - Styles
   ============================== */

/* CSS Variables */
:root {
    --primary: #c41e3a;
    --primary-dark: #a01830;
    --primary-light: #fff0f3;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --dark: #333;
    --gray: #666;
    --gray-light: #999;
    --border: #e0e0e0;
    --bg: #f5f7fa;
    --white: #fff;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-page.loaded {
    opacity: 1;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.login-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

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

.login-logo .subtitle {
    color: var(--gray);
    font-size: 0.95rem;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.form-group input::placeholder {
    color: var(--gray-light);
}

.error-message {
    background: var(--primary-light);
    color: var(--primary);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(196, 30, 58, 0.2);
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.login-footer p {
    color: var(--gray-light);
    font-size: 0.85rem;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

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

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

.btn-primary:disabled {
    background: var(--gray-light);
    cursor: not-allowed;
    transform: none;
}

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

.btn-secondary:hover {
    background: #d0d0d0;
}

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

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

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

.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    padding: 1.5rem 2rem;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.stat-card {
    background: var(--bg);
    padding: 1.25rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    transition: transform 0.2s ease;
}

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

.stat-card .number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
}

.stat-card .label {
    color: var(--gray);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.info { border-left-color: var(--info); }

/* Controls */
.controls {
    padding: 1.25rem 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-box::before {
    content: "\1F50D";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
}

.filter-select {
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: var(--white);
    cursor: pointer;
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============================================
   TABLE
   ============================================ */

.table-container {
    padding: 1.5rem 2rem 2rem;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg);
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: var(--bg);
}

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

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-new {
    background: #e3f2fd;
    color: #1565c0;
}

.status-partial {
    background: #fff3e0;
    color: #e65100;
}

.status-contacted {
    background: #f3e5f5;
    color: #7b1fa2;
}

.status-enrolled {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-rejected {
    background: #ffebee;
    color: #c62828;
}

/* Action Buttons */
.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 4px;
    transition: all 0.2s ease;
}

.view-btn {
    background: #e3f2fd;
    color: #1565c0;
}

.view-btn:hover {
    background: #bbdefb;
}

.delete-btn {
    background: #ffebee;
    color: #c62828;
}

.delete-btn:hover {
    background: #ffcdd2;
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 700px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

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

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--primary);
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h3 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}

.detail-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--gray);
    font-size: 0.875rem;
}

.detail-value {
    color: var(--dark);
}

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

.detail-value a:hover {
    text-decoration: underline;
}

/* File Items */
.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-icon {
    font-size: 1.5rem;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: var(--dark);
    font-size: 0.9rem;
}

.file-type {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Notes Section */
.notes-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}

.note-input-container {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.note-input-container textarea {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.note-input-container textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.note {
    background: var(--bg);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.note-author {
    font-weight: 600;
    color: var(--primary);
}

.note-date {
    color: var(--gray);
}

.note-content {
    color: var(--dark);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ============================================
   EMPTY & LOADING STATES
   ============================================ */

.loading-state,
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

/* ============================================
   STATUS UPDATE DROPDOWN
   ============================================ */

.status-update {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.status-update select {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.status-update select:focus {
    outline: none;
    border-color: var(--primary);
}

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

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }

    .header-right {
        flex-direction: column;
        gap: 0.75rem;
    }

    .stats-bar {
        grid-template-columns: 1fr 1fr;
        padding: 1rem;
    }

    .controls {
        flex-direction: column;
        padding: 1rem;
    }

    .search-box {
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }

    .table-container {
        padding: 1rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .note-input-container {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .stats-bar {
        grid-template-columns: 1fr;
    }

    .login-box {
        padding: 1.5rem;
    }

    .action-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray); }
.text-small { font-size: 0.875rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
