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

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #13192e;
    --bg-tertiary: #1b233d;
    --accent: #ff4a57;
    --accent-hover: #e03b47;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --border: #2d3748;
    --success: #38a169;
    --warning: #dd6b20;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(19, 25, 46, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Authentication Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(90deg,#7c2d94 0%, #5d55b7 100%);
    padding: 20px;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--card-shadow);
    text-align: center;
}

.login-card h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.login-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 30px;
}

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

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

.form-control {
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 74, 87, 0.2);
}

.btn-primary {
    display: inline-block;
    width: 100%;
    background-color: var(--accent);
    color: var(--text-primary);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    display: inline-block;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: var(--border);
}

.alert {
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: left;
}

.alert-danger {
    background-color: rgba(224, 60, 71, 0.15);
    border: 1px solid var(--accent);
    color: #ff8a93;
}

/* Dashboard Layout */
.admin-navbar {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand span {
    color: var(--accent);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar-user span {
    font-size: 14px;
    color: var(--text-secondary);
}

.btn-logout {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn-logout:hover {
    color: var(--accent);
    border-color: rgba(255, 74, 87, 0.3);
    background-color: rgba(255, 74, 87, 0.05);
}

.main-content {
    flex: 1;
    padding: 40px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

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

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--card-shadow);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .value span {
    color: var(--accent);
}

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

.table-responsive {
    overflow-x: auto;
}

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

th {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    padding: 16px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    color: var(--text-secondary);
    vertical-align: middle;
}

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

tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.post-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    background-color: var(--bg-tertiary);
}

.post-title-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-published {
    background-color: rgba(56, 161, 105, 0.15);
    color: #48bb78;
    border: 1px solid rgba(56, 161, 105, 0.3);
}

.badge-draft {
    background-color: rgba(221, 107, 32, 0.15);
    color: #ed8936;
    border: 1px solid rgba(221, 107, 32, 0.3);
}

.actions-cell {
    display: flex;
    gap: 10px;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    background-color: var(--bg-tertiary);
}

.btn-action:hover {
    background-color: var(--border);
}

.btn-action-edit:hover {
    color: #4299e1;
    border-color: rgba(66, 153, 225, 0.5);
}

.btn-action-delete:hover {
    color: var(--accent);
    border-color: rgba(255, 74, 87, 0.5);
}

/* Edit / Create Form Styling */
.form-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--card-shadow);
}

.form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

@media (max-width: 900px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.image-preview-box {
    width: 100%;
    height: 180px;
    border-radius: 8px;
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background-color: var(--bg-tertiary);
}

.image-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-box span {
    font-size: 14px;
    color: var(--text-secondary);
}

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

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Responsive elements */
@media (max-width: 768px) {
    .admin-navbar {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .page-header .btn-primary {
        width: auto;
    }
}
