﻿/* ========================================
   BC Portal Admin Styles
   ======================================== */

/* Variables */
:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --secondary: #1e3a5f;
    --dark: #0f172a;
    --light: #f8fafc;
    --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;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --error: #dc2626;
    --error-bg: #fee2e2;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --radius: 10px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--gray-100);
}

/* ========================================
   Login Page
   ======================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark) 0%, var(--secondary) 50%, var(--primary) 100%);
    padding: 1rem;
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.login-logo h1 {
    color: var(--dark);
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
}

.login-logo p {
    color: var(--gray-500);
    margin: 0.25rem 0 0 0;
    font-size: 0.9rem;
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-400);
    font-size: 0.8rem;
}

/* ========================================
   Admin Layout
   ======================================== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--dark) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

    .sidebar-header h2 {
        margin: 0 0 0.25rem 0;
        font-size: 1.35rem;
        font-weight: 700;
    }

    .sidebar-header .user-name {
        font-size: 0.85rem;
        opacity: 0.7;
    }

.nav-menu {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
    flex: 1;
}

.nav-item {
    padding: 0.875rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
}

    .nav-item:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .nav-item.active {
        background: rgba(13, 148, 136, 0.2);
        border-left-color: var(--primary);
    }

    .nav-item .icon {
        width: 20px;
        text-align: center;
    }

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-logout {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

    .btn-logout:hover {
        background: rgba(255, 255, 255, 0.2);
    }

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    background: var(--gray-100);
    min-height: 100vh;
}

.top-header {
    background: white;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

    .top-header h1 {
        margin: 0;
        font-size: 1.5rem;
        color: var(--dark);
        font-weight: 600;
    }

.content-area {
    padding: 2rem;
}

/* ========================================
   Cards & Stats
   ======================================== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    }

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--gray-100);
}

.card-info {
    display: flex;
    flex-direction: column;
}

.card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
}

.card-label {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ========================================
   Tables
   ======================================== */
.data-table {
    width: 100%;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border-collapse: collapse;
}

    .data-table th,
    .data-table td {
        padding: 1rem 1.25rem;
        text-align: left;
    }

    .data-table th {
        background: var(--gray-50);
        font-weight: 600;
        color: var(--gray-600);
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.025em;
        border-bottom: 2px solid var(--gray-200);
    }

    .data-table td {
        border-bottom: 1px solid var(--gray-100);
        color: var(--gray-700);
    }

    .data-table tr:last-child td {
        border-bottom: none;
    }

    .data-table tr:hover td {
        background: var(--gray-50);
    }

.url-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--gray-400);
    font-size: 0.85rem;
}

/* Status Badge */
.status {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

    .status.active {
        background: var(--success-bg);
        color: var(--success);
    }

    .status.inactive {
        background: var(--error-bg);
        color: var(--error);
    }

/* Action Buttons */
.actions-cell {
    display: flex;
    gap: 0.5rem;
}

.btn-edit,
.btn-delete,
.btn-view {
    padding: 0.4rem 0.875rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-edit {
    background: #dbeafe;
    color: #2563eb;
}

    .btn-edit:hover {
        background: #bfdbfe;
    }

.btn-delete {
    background: var(--error-bg);
    color: var(--error);
}

    .btn-delete:hover {
        background: #fecaca;
    }

.btn-view {
    background: var(--gray-100);
    color: var(--gray-600);
}

    .btn-view:hover {
        background: var(--gray-200);
    }

/* ========================================
   Buttons
   ======================================== */
.btn-add {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

    .btn-add:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 20px -10px rgba(13, 148, 136, 0.5);
    }

/* ========================================
   Forms
   ======================================== */
.form-group {
    margin-bottom: 1.25rem;
}

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 600;
        color: var(--gray-700);
        font-size: 0.9rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 0.875rem 1rem;
        border: 2px solid var(--gray-200);
        border-radius: var(--radius);
        font-size: 1rem;
        transition: all 0.2s ease;
        background: var(--gray-50);
    }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: var(--primary);
            background: white;
            box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
        }

        .form-group input::placeholder {
            color: var(--gray-400);
        }

    .form-group small {
        display: block;
        margin-top: 0.35rem;
        color: var(--gray-400);
        font-size: 0.8rem;
    }

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* ========================================
   Alerts & Messages
   ======================================== */
.alert-error {
    background: linear-gradient(135deg, #fef2f2, var(--error-bg));
    border: 1px solid #fecaca;
    color: var(--error);
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.message {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin: 0 2rem 1rem;
    font-size: 0.9rem;
}

    .message.success {
        background: var(--success-bg);
        color: var(--success);
        border: 1px solid #bbf7d0;
    }

    .message.error {
        background: var(--error-bg);
        color: var(--error);
        border: 1px solid #fecaca;
    }

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlide 0.2s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .modal-header h2 {
        margin: 0;
        color: var(--dark);
        font-size: 1.25rem;
    }

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

    .btn-close:hover {
        color: var(--gray-600);
    }

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-cancel {
    padding: 0.75rem 1.5rem;
    background: var(--gray-100);
    color: var(--gray-600);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

    .btn-cancel:hover {
        background: var(--gray-200);
    }

.btn-save {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

    .btn-save:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 20px -10px rgba(13, 148, 136, 0.5);
    }

/* ========================================
   Empty States
   ======================================== */
.no-data {
    background: white;
    padding: 3rem;
    text-align: center;
    border-radius: var(--radius);
    color: var(--gray-500);
    box-shadow: var(--shadow);
}

    .no-data .btn-add {
        margin-top: 1rem;
    }

/* Not Logged In */
.not-logged-in {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--gray-500);
}

    .not-logged-in button {
        padding: 0.75rem 2rem;
        background: var(--primary);
        color: white;
        border: none;
        border-radius: var(--radius);
        cursor: pointer;
        font-weight: 600;
    }

/* ========================================
   Section Headers
   ======================================== */
.section-header {
    margin-bottom: 1rem;
}

    .section-header h2 {
        color: var(--dark);
        margin: 0;
        font-size: 1.125rem;
        font-weight: 600;
    }

/* ========================================
   Spinner
   ======================================== */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Login Button
   ======================================== */
.btn-login {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

    .btn-login:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 20px -10px rgba(13, 148, 136, 0.5);
    }

    .btn-login:disabled {
        background: var(--gray-400);
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }
