/* ==========================================================================
   Admin Panel Styles
   ========================================================================== */

/* CSS Variables */
:root {
    --admin-primary: #4f46e5;
    --admin-primary-dark: #4338ca;
    --admin-secondary: #6366f1;
    --admin-text: #1e293b;
    --admin-text-light: #64748b;
    --admin-bg: #f8fafc;
    --admin-bg-dark: #e2e8f0;
    --admin-border: #cbd5e1;
    --admin-success: #10b981;
    --admin-error: #ef4444;
    --admin-warning: #f59e0b;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.login-card h1 {
    font-size: 1.875rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-align: center;
    color: var(--admin-text);
}

.subtitle {
    text-align: center;
    color: var(--admin-text-light);
    margin-bottom: 2rem;
}

/* Admin Navigation */
.admin-nav {
    background: var(--admin-primary);
    color: white;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    display: flex;
    align-items: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    padding: 1rem 0;
}

.nav-logo {
    max-height: 40px;
    filter: brightness(0) invert(1);
}

.nav-title {
    font-weight: 700;
}

.nav-menu {
    display: none;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .nav-menu {
        display: flex;
    }
}

.nav-link {
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.nav-mobile-toggle {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    cursor: pointer;
    padding: 0.5rem;
}

@media (min-width: 768px) {
    .nav-mobile-toggle {
        display: none;
    }
}

.nav-mobile-toggle span {
    width: 24px;
    height: 2px;
    background: white;
}

/* Admin Container */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.admin-content {
    padding: 2rem 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--admin-text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 0.9375rem;
    min-height: 44px;
}

.btn-primary {
    background: var(--admin-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--admin-primary-dark);
    color: white;
}

.btn-secondary {
    background: var(--admin-text-light);
    color: white;
}

.btn-secondary:hover {
    background: var(--admin-text);
    color: white;
}

.btn-danger {
    background: var(--admin-error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    min-height: 36px;
}

.btn-block {
    width: 100%;
}

.btn-disabled {
    background: var(--admin-bg-dark);
    color: var(--admin-text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--admin-text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--admin-border);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea {
    resize: vertical;
}

small {
    display: block;
    margin-top: 0.375rem;
    color: var(--admin-text-light);
    font-size: 0.875rem;
}

.current-image {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--admin-bg);
    border-radius: 0.5rem;
}

.current-image img {
    max-width: 300px;
    border-radius: 0.5rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Data Table */
.data-table {
    width: 100%;
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.data-table thead {
    background: var(--admin-bg);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--admin-text);
    border-bottom: 1px solid var(--admin-border);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--admin-bg-dark);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: var(--admin-bg);
}

.data-table code {
    background: var(--admin-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--admin-text);
}

.stat-label {
    color: var(--admin-text-light);
    font-size: 0.875rem;
}

/* Quick Actions */
.quick-actions {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
}

.quick-actions h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Recent Posts */
.recent-posts {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.recent-posts h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* Settings Sections */
.settings-section {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
}

.settings-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--admin-border);
}

.settings-section h3 {
    font-size: 1.125rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.text-muted {
    color: var(--admin-text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: white;
    border-radius: 0.75rem;
}

.empty-state p {
    color: var(--admin-text-light);
    margin-bottom: 1.5rem;
}

/* Footer */
.admin-footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--admin-text-light);
    font-size: 0.875rem;
}

/* Login Footer */
.login-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.back-link {
    color: var(--admin-text-light);
    font-size: 0.9375rem;
}

.back-link:hover {
    color: var(--admin-primary);
}

/* Responsive Table */
@media (max-width: 767px) {
    .data-table {
        display: block;
        overflow-x: auto;
    }
}