/*
 * CMS Premium Design System
 */

:root {
    --primary-bg: #0d121c;
    --card-bg: rgba(18, 25, 38, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-white: #ffffff;
    --text-dim: #a0aec0;
    --accent-gold: #f4d35e;
    --accent-emerald: #2ecc71;
    --accent-red: #ff4d4d;
    --font-main: 'Outfit', sans-serif;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--primary-bg);
    color: var(--text-white);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

/* Background Animation Placeholder */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(244, 211, 94, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(46, 204, 113, 0.05) 0%, transparent 40%);
    z-index: -1;
}

/* Typography */
h1, h2, h3 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hidden {
    display: none !important;
}

/* Login Page Styles */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.login-box {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.login-box h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    color: var(--accent-gold);
}

.login-box .subtitle {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

.input-field {
    text-align: left;
    margin-bottom: 20px;
}

.input-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dim);
}

.input-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--accent-gold);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 15px rgba(244, 211, 94, 0.1);
}

.input-wrapper i {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-right: 12px;
}

.input-wrapper input, .input-wrapper textarea, .input-wrapper select {
    background: transparent;
    border: none;
    color: var(--text-white);
    padding: 12px 0;
    width: 100%;
    font-size: 0.95rem;
    outline: none;
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), #d4af37);
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 12px 25px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(244, 211, 94, 0.4);
}

.error-msg {
    color: var(--accent-red);
    font-size: 0.85rem;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Dashboard Layout */
.dashboard-page {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.dash-header h2 {
    font-size: 1.8rem;
    color: var(--accent-gold);
}

.user-profile {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    padding: 6px 15px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--accent-red);
    color: #fff;
}

/* Main Grid */
.dash-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow-soft);
}

.card h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.col-full {
    grid-column: span 2;
}

.input-field.seo-highlight .input-wrapper {
    border-left: 3px solid var(--accent-gold);
}

.char-counter {
    font-size: 0.7rem;
    text-align: right;
    margin-top: 4px;
    color: var(--text-dim);
}

/* Rich Text Editor */
.editor-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    overflow: hidden;
}

.editor-toolbar {
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.tool-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-white);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--glass-border);
}

.editor-content {
    min-height: 300px;
    padding: 20px;
    outline: none;
    color: var(--text-white);
    font-size: 1rem;
}

.editor-content h1 { font-size: 1.8rem; margin: 15px 0; }
.editor-content h2 { font-size: 1.5rem; margin: 12px 0; }
.editor-content h3 { font-size: 1.2rem; margin: 10px 0; }
.editor-content ul, .editor-content ol { padding-left: 30px; margin: 10px 0; }

/* Image Upload Preview */
.image-preview-area {
    width: 100%;
    height: 180px;
    border: 2px dashed var(--glass-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.image-preview-area:hover {
    border-color: var(--accent-gold);
}

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

/* Blog Table List */
.blog-table-container {
    overflow-x: auto;
}

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

th {
    text-align: left;
    padding: 12px 15px;
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.9rem;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-Published { background: rgba(46, 204, 113, 0.15); color: var(--accent-emerald); }
.status-Draft { background: rgba(255, 255, 255, 0.1); color: var(--text-dim); }

.action-btns {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-white);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); }
.icon-btn.delete:hover { border-color: var(--accent-red); color: var(--accent-red); }

/* Public Blog Listing */
.public-page {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.public-title {
    text-align: center;
    margin-bottom: 60px;
}

.public-title h1 {
    font-size: 3rem;
    background: linear-gradient(to right, var(--accent-gold), #fff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.blog-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-gold);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.card-img {
    height: 200px;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .card-img img {
    transform: scale(1.1);
}

.card-body {
    padding: 25px;
    flex-grow: 1;
}

.card-body h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: var(--accent-gold);
}

.card-body p {
    font-size: 0.95rem;
    color: var(--text-dim);
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Detail Page */
.detail-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px;
}

.detail-header {
    margin-bottom: 40px;
    text-align: center;
}

.detail-header h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.detail-hero {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 40px;
    border: 1px solid var(--glass-border);
}

.detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-title {
    font-size: clamp(2rem, 8vw, 3.5rem);
    line-height: 1.1;
    margin-bottom: 30px;
    color: #fff;
}

.detail-content {
    font-size: 1.1rem;
    color: #e2e8f0;
}

/* Responsive */
@media (max-width: 1024px) {
    .dash-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .detail-header h1 { font-size: 2rem; }
    .form-grid { grid-template-columns: 1fr; }
    .col-full { grid-column: auto; }
    .public-title h1 { font-size: 2.2rem; }
    .public-page header, .detail-page-body header { flex-direction: column; gap: 20px; text-align: center; }
}

@media (max-width: 480px) {
    .login-box { padding: 25px 15px; }
    .login-box h1 { font-size: 1.8rem; }
    .detail-hero { border-radius: 10px; margin-bottom: 25px; }
    .detail-content { font-size: 1rem; }
    .blog-grid { grid-template-columns: 1fr; }
}
