/**
 * E-SLIP Admin CMS Styles
 */

/* Login Page */
:root {
    --eslip-dark: #2d343e;
    --eslip-dark-2: #1a252f;
    --eslip-accent: #e74c3c;
}

.login-page {
    /* Match main site header/nav colors */
    background: linear-gradient(135deg, #ffffff 20%,  #7cb751 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.login-box {
    /* Match main site header background */
    background: #2d343e;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.35);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    margin: 20px;
    border: 1px solid rgba(255,255,255,0.08);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    max-width: 150px;
    height: auto;
    cursor: pointer;
}

.login-logo h1 {
    margin-top: 15px;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
}

.login-logo p {
    color: rgba(255,255,255,0.75);
    margin-top: 5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
    background: rgba(255,255,255,0.95);
    color: #2d343e;
}

.form-group input:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

.btn-login {
    width: 100%;
    padding: 12px;
    /* Use site-like dark nav gradient */
    background: linear-gradient(135deg, #2d343e 0%, #1a252f 100%);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
    border-color: rgba(231, 76, 60, 0.45);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.forgot-password {
    text-align: center;
    margin-top: 15px;
}

.forgot-password a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 14px;
}

.forgot-password a:hover {
    text-decoration: underline;
    color: #fff;
}

.alert {
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger {
    background-color: rgba(231, 76, 60, 0.12);
    border: 1px solid rgba(231, 76, 60, 0.35);
    color: #ffd6d2;
}

.alert-success {
    background-color: rgba(56, 239, 125, 0.12);
    border: 1px solid rgba(56, 239, 125, 0.35);
    color: #d7ffe6;
}

.alert-info {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
}

/* Admin Dashboard */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: #2c3e50;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.admin-sidebar-header {
    padding: 20px;
    background: #1a252f;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.admin-sidebar-header p {
    margin: 5px 0 0;
    font-size: 12px;
    opacity: 0.7;
}

.admin-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-menu > li {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.admin-menu a {
    display: block;
    padding: 15px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.admin-menu a:hover,
.admin-menu a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    padding-left: 25px;
}

.admin-menu i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.admin-content {
    margin-left: 260px;
    flex: 1;
    background: #f4f6f9;
}

/* Admin forms (scoped so login page remains unchanged) */
.admin-content .form-group label {
    color: #333;
}

.admin-content .form-group input,
.admin-content .form-group select,
.admin-content .form-group textarea,
.admin-content .form-control {
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
}

.admin-content .form-group input:focus,
.admin-content .form-group select:focus,
.admin-content .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.18);
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 220px;
}

.admin-header {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.admin-user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-user-menu .user-info {
    text-align: right;
}

.admin-user-menu .user-info strong {
    display: block;
    color: #333;
}

.admin-user-menu .user-info small {
    color: #666;
}

.admin-user-menu .btn {
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}

.btn-logout {
    background: #e74c3c;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-logout:hover {
    background: #c0392b;
}

.admin-main {
    padding: 30px;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-info h3 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.stat-info p {
    margin: 5px 0 0;
    color: #666;
    font-size: 14px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-success {
    background: #38ef7d;
    color: white;
}

.btn-success:hover {
    background: #2dd66c;
}

.btn-danger {
    background: #f5576c;
    color: white;
}

.btn-danger:hover {
    background: #e4465b;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table-actions {
    display: flex;
    gap: 10px;
}

.table-actions .btn {
    padding: 5px 10px;
    font-size: 12px;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form field helper text (consistent across admin forms) */
.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.35;
    color: #6c757d;
    font-weight: 500;
}

/* When a hint follows a label and should sit closer */
label + .form-hint {
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-260px);
        transition: transform 0.3s;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
