/*
 * Banana Motors Admin Dashboard CSS
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-admin: #0b0c0e;
    --bg-card: #15161a;
    --sidebar-bg: #111216;
    --primary: #e30613;
    --accent: #f5b21f;
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --border: #222329;
    --border-hover: #32343e;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --font-sans: 'Outfit', sans-serif;
    --sidebar-width: 260px;
    --transition: 0.25s ease;
}

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

body {
    background-color: var(--bg-admin);
    color: var(--text);
    font-family: var(--font-sans);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- Admin Layout --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand img {
    height: 36px;
    width: auto;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.menu-item a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.03);
}

.menu-item.active a {
    color: #ffffff;
    background-color: var(--primary);
    box-shadow: 0 4px 12px rgba(227, 6, 19, 0.25);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.user-info i {
    color: var(--accent);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.logout-btn:hover {
    background: var(--danger);
    color: #ffffff;
}

/* --- Main Content Area --- */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 40px;
    width: calc(100% - var(--sidebar-width));
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
}

.admin-header h1 {
    font-size: 1.85rem;
    font-weight: 700;
    color: #ffffff;
}

.admin-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* --- Stat Cards --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 36px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary { background: rgba(227, 6, 19, 0.08); color: var(--primary); }
.stat-icon.accent { background: rgba(245, 178, 31, 0.08); color: var(--accent); }
.stat-icon.success { background: rgba(16, 185, 129, 0.08); color: var(--success); }
.stat-icon.info { background: rgba(59, 130, 246, 0.08); color: #3b82f6; }

.stat-details h3 {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-details p {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Data Table --- */
.card-table {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 36px;
}

.card-table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-table-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background-color: rgba(255, 255, 255, 0.02);
    padding: 16px 24px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 16px 24px;
    font-size: 0.95rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

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

tr:hover td {
    background-color: rgba(255, 255, 255, 0.01);
}

/* --- Status Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-new { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-read { background: rgba(156, 163, 175, 0.1); color: var(--text-muted); border: 1px solid rgba(156, 163, 175, 0.2); }

/* --- Buttons --- */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
}

.btn-view { background: rgba(245, 178, 31, 0.1); color: var(--accent); border-color: rgba(245, 178, 31, 0.2); }
.btn-view:hover { background: var(--accent); color: #000000; }

.btn-read { background: rgba(16, 185, 129, 0.1); color: var(--success); border-color: rgba(16, 185, 129, 0.2); }
.btn-read:hover { background: var(--success); color: #ffffff; }

.btn-delete { background: rgba(239, 68, 68, 0.1); color: var(--danger); border-color: rgba(239, 68, 68, 0.2); }
.btn-delete:hover { background: var(--danger); color: #ffffff; }

.btn-add {
    background: var(--primary);
    color: #ffffff;
    padding: 10px 20px;
    font-size: 0.9rem;
    border-radius: 6px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-add:hover {
    background: #c50510;
    box-shadow: 0 4px 12px rgba(227, 6, 19, 0.3);
}

/* --- Modal Details Display --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: modalFade var(--transition) forwards;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}
.modal-close:hover { color: #ffffff; }

.modal-body {
    padding: 24px;
}

.modal-detail-row {
    margin-bottom: 16px;
}
.modal-detail-row:last-child { margin-bottom: 0; }

.modal-detail-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.modal-detail-val {
    font-size: 1rem;
    color: #ffffff;
    font-weight: 500;
}

.modal-message-box {
    background-color: var(--bg-admin);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* --- CMS Form Styling --- */
.cms-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.admin-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-form-group.full-width {
    grid-column: span 2;
}

.admin-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.admin-input {
    background-color: var(--bg-admin);
    border: 1px solid var(--border);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition);
}

.admin-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(227, 6, 19, 0.2);
}

textarea.admin-input {
    min-height: 120px;
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.btn-submit {
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}
.btn-submit:hover { background-color: #c50510; }

.btn-cancel {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}
.btn-cancel:hover { background: rgba(255, 255, 255, 0.02); color: #ffffff; }

/* Image upload preview */
.img-preview-box {
    margin-top: 8px;
    border: 1px dashed var(--border);
    border-radius: 6px;
    padding: 8px;
    max-width: 150px;
    aspect-ratio: 16/10;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.2);
}
.img-preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* --- Login Page specific --- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-admin);
    width: 100%;
}

.login-container {
    max-width: 420px;
    width: 90%;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    border-top: 4px solid var(--primary);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    height: 48px;
    width: auto;
}

.login-title {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 8px;
    font-weight: 700;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 30px;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .sidebar-menu {
        flex-direction: row;
        padding: 12px;
        overflow-x: auto;
        gap: 6px;
    }
    
    .menu-item a {
        padding: 8px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .admin-form-group.full-width {
        grid-column: span 1;
    }
}
