/**
 * Admin Panel Stylesheet
 * Clean, modern dashboard design
 */

:root {
    --admin-primary: #2c3e95;
    --admin-primary-dark: #1e2a6b;
    --admin-secondary: #d4af37;
    --admin-sidebar: #1a1f36;
    --admin-sidebar-hover: #252b48;
    --admin-border: #e1e4e8;
    --admin-bg: #f6f8fa;
    --admin-text: #24292e;
    --admin-text-light: #586069;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--admin-text);
    background: var(--admin-bg);
}

/* ==================== Login Page ==================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--admin-primary) 0%, var(--admin-primary-dark) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

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

.login-logo {
    max-width: 150px;
    margin: 0 auto 20px;
}

.login-header h1 {
    font-size: 24px;
    color: var(--admin-primary);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--admin-text-light);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--admin-text);
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--admin-border);
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--admin-primary);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: var(--admin-primary);
    text-decoration: none;
}

/* ==================== Admin Layout ==================== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--admin-sidebar);
    color: white;
    flex-shrink: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-logo {
    max-width: 120px;
    margin: 0 auto 15px;
}

.sidebar-header h2 {
    font-size: 20px;
    color: white;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    padding: 15px 20px 5px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.nav-item i {
    width: 20px;
    margin-right: 12px;
}

.nav-item:hover,
.nav-item.active {
    background: var(--admin-sidebar-hover);
    color: white;
}

.nav-item.active:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--admin-secondary);
}

.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

/* ==================== Top Bar ==================== */
.admin-topbar {
    background: white;
    border-bottom: 1px solid var(--admin-border);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--admin-text);
}

.topbar-left h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-menu {
    position: relative;
}

.user-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background 0.3s;
}

.user-toggle:hover {
    background: var(--admin-bg);
}

.user-toggle i {
    font-size: 24px;
    color: var(--admin-primary);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border: 1px solid var(--admin-border);
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    display: none;
}

.user-menu:hover .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 12px 20px;
    color: var(--admin-text);
    text-decoration: none;
    transition: background 0.3s;
}

.user-dropdown a:hover {
    background: var(--admin-bg);
}

.user-dropdown a i {
    margin-right: 10px;
    width: 20px;
}

/* ==================== Content Area ==================== */
.admin-content {
    flex: 1;
    padding: 30px;
}

.content-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==================== Alerts ==================== */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-color: var(--success);
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-color: var(--danger);
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: var(--warning);
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: var(--info);
    color: #0c5460;
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--admin-primary-dark);
}

.btn-secondary {
    background: var(--admin-text-light);
    color: white;
    border-color: var(--admin-text-light);
}

.btn-secondary:hover {
    background: var(--admin-text);
}

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

.btn-danger:hover {
    background: #c82333;
}

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

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

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn i {
    margin-right: 5px;
}

/* ==================== Dashboard ==================== */
.dashboard-grid {
    display: grid;
    gap: 30px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-content h3 {
    font-size: 28px;
    font-weight: bold;
    margin: 0;
}

.stat-content p {
    color: var(--admin-text-light);
    margin: 0;
}

.dashboard-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.btn-link {
    color: var(--admin-primary);
    text-decoration: none;
    font-weight: 500;
}

.btn-link:hover {
    text-decoration: underline;
}

.dashboard-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 25px;
    background: var(--admin-bg);
    border-radius: 10px;
    color: var(--admin-text);
    text-decoration: none;
    transition: all 0.3s;
}

.action-btn:hover {
    background: var(--admin-primary);
    color: white;
    transform: translateY(-3px);
}

.action-btn i {
    font-size: 32px;
}

/* ==================== Tables ==================== */
.data-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: var(--admin-bg);
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--admin-text);
    border-bottom: 2px solid var(--admin-border);
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--admin-border);
}

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

.actions {
    display: flex;
    gap: 5px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: var(--success);
}

.badge-secondary {
    background: var(--admin-bg);
    color: var(--admin-text-light);
}

.badge-primary {
    background: #cce5ff;
    color: var(--admin-primary);
}

/* ==================== Forms ==================== */
.form-container {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.admin-form {
    max-width: 900px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--admin-text);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--admin-border);
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--admin-primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--admin-text-light);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--admin-border);
}

.col-md-4 { grid-column: span 1; }
.col-md-6 { grid-column: span 2; }
.col-md-8 { grid-column: span 3; }

/* ==================== Messages List ==================== */
.messages-list {
    display: grid;
    gap: 15px;
}

.message-item {
    background: var(--admin-bg);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--admin-border);
    transition: all 0.3s;
}

.message-item.unread {
    background: #e7f3ff;
    border-left-color: var(--admin-primary);
}

.message-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.message-email {
    color: var(--admin-text-light);
    font-size: 13px;
}

.message-preview {
    margin-bottom: 10px;
    color: var(--admin-text);
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--admin-text-light);
}

/* ==================== Footer ==================== */
.admin-footer {
    background: white;
    border-top: 1px solid var(--admin-border);
    padding: 20px 30px;
    text-align: center;
    color: var(--admin-text-light);
}

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .dashboard-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-content {
        padding: 20px;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .col-md-4,
    .col-md-6,
    .col-md-8 {
        grid-column: span 1;
    }

    .topbar-left h1 {
        font-size: 18px;
    }
}
