/* =========================================================
   ADMIN CENTRAL CSS - Blogger Engine
   Unified styling for all admin pages.
========================================================= */

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    margin: 0; 
    background: #f0f2f5; 
    color: #1c1e21; 
    padding: 40px 20px; 
}

.container { 
    max-width: 1100px; 
    margin: 0 auto; 
    background: #fff; 
    padding: 35px 40px; 
    border-radius: 16px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.06); 
    box-sizing: border-box;
    width: 100%;
}

.card-small {
    max-width: 450px;
}

.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

/* Page Header */
h1 { color: #1c1e21; margin: 0 0 10px; font-weight: 800; font-size: 1.8rem; }
.subtitle { 
    color: #65676b; 
    margin-bottom: 30px; 
    border-bottom: 1px solid #ebedf0; 
    padding-bottom: 25px; 
    font-size: 14px;
    line-height: 1.6;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #65676b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.back-link:hover { color: #1c1e21; }

.nav { 
    margin-bottom: 35px; 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap; 
}
.nav a { 
    padding: 10px 18px; 
    background: #f0f2f5; 
    color: #4b4f56; 
    text-decoration: none; 
    border-radius: 10px; 
    font-weight: 600; 
    font-size: 13.5px; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    border: 1px solid transparent;
}
.nav a:hover { background: #e4e6eb; color: #1c1e21; transform: translateY(-1px); }
.nav a.primary { background: #1877f2; color: #fff; }
.nav a.primary:hover { background: #166fe5; color: #fff; }

/* Tables */
.table-wrapper { width: 100%; overflow-x: auto; margin-top: 10px; border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #f1f4f6; }
th { background: #f8f9fa; color: #8e959b; font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; }
tr:hover { background: #fdfdfd; }

/* Buttons */
.btn { 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px; 
    border-radius: 10px; 
    text-decoration: none; 
    font-size: 14px; 
    font-weight: 600; 
    border: none; 
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 8px;
    box-sizing: border-box;
}

.btn:hover { 
    transform: translateY(-1px); 
    filter: brightness(105%);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary { 
    background: #1877f2; 
    color: #ffffff; 
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.2);
}

.btn-secondary { 
    background: #f0f2f5; 
    color: #4b4f56; 
}
.btn-secondary:hover { background: #e4e6eb; }

.btn-success { 
    background: #42b72a; 
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(66, 183, 42, 0.15);
}

.btn-danger { 
    background: #fa3e3e; 
    color: #ffffff; 
    box-shadow: 0 4px 12px rgba(250, 62, 62, 0.15);
}

.btn-warning { 
    background: #f39c12; 
    color: #ffffff;
}

.btn-ghost {
    background: transparent;
    color: #65676b;
    border: 1px solid #ebedf0;
}
.btn-ghost:hover {
    background: #f8f9fa;
    border-color: #ddd;
}

/* Size Modifiers */
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; display: flex; }

/* Action Specific Aliases (Backward Compatibility / Semantic) */
.btn-view {
    background: transparent;
    color: #65676b;
    border: 1px solid #ebedf0;
}
.btn-view:hover { background: #f8f9fa; border-color: #ddd; }

.btn-edit {
    background: #1877f2;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.2);
}

.btn-delete {
    background: #fa3e3e;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(250, 62, 62, 0.15);
}

.btn-archive {
    background: #f39c12;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.15);
}

.btn-save {
    background: #42b72a;
    color: #ffffff;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(66, 183, 42, 0.2);
}


/* Forms */
.form-group { margin-bottom: 25px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #34495e; }

input[type="text"], 
input[type="email"], 
input[type="password"], 
textarea { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid #ddd; 
    border-radius: 8px; 
    box-sizing: border-box; 
    font-size: 15px; 
    outline: none;
    background: #fff;
    transition: all 0.2s;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus { 
    border-color: #3498db; 
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}
.hint { font-size: 12px; color: #7f8c8d; margin-top: 6px; }

.form-inline-group { display: flex; gap: 10px; }
.form-inline-group input { flex: 1; }

@media (max-width: 480px) {
    .form-inline-group { flex-direction: column; }
    .form-inline-group button { width: 100%; }
}

/* Alerts & Feedback */
.alert, .error-msg, .error { 
    padding: 16px 20px; 
    border-radius: 12px; 
    margin-bottom: 25px; 
    font-size: 14.5px; 
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.5;
    border-width: 1px;
    border-style: solid;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.alert-success { background: #e7f3ff; color: #1877f2; border-color: #d1e7ff; }
.alert-error, .error-msg, .error { background: #fff1f0; border-color: #ffa39e; color: #cf1322; }

/* Icon placeholder if needed */
.alert::before { font-size: 18px; }
.alert-success::before { content: "✅"; }
.alert-error::before { content: "❌"; }

.warning-box {
    background: #fff5f5;
    color: #c0392b;
    padding: 15px;
    border-radius: 10px;
    font-size: 14px;
    border: 1px solid #fed7d7;
    margin-bottom: 25px;
}

/* Page Header Section (Responsive Flex) */
.page-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px;
    gap: 15px;
}

.page-header h1 { margin: 0; }

@media (max-width: 600px) {
    .page-header { flex-direction: column; align-items: stretch; text-align: center; gap: 10px; margin-bottom: 20px; }
    .page-header h1 { font-size: 1.4rem; }
    .page-header .btn { width: 100%; padding: 12px; }
}

/* Dashboard Header Section */
.header-section { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    margin-bottom: 30px; 
    border-bottom: 2px solid #f1f4f6; 
    padding-bottom: 20px; 
}
.user-info { text-align: right; font-size: 14px; }
.logout-link { color: #e74c3c; text-decoration: none; font-weight: bold; margin-top: 5px; display: block; }

/* Blog Selector Styling */
.blog-selector { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.blog-selector select { 
    padding: 10px 15px; 
    border-radius: 8px; 
    border: 1px solid #ddd; 
    font-size: 14px; 
    font-weight: 600; 
    cursor: pointer; 
    background: #fff; 
    color: #2c3e50;
    transition: all 0.2s;
    outline: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.blog-selector select:focus { 
    border-color: #3498db; 
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1); 
}
.blog-selector a { 
    font-size: 13px; 
    text-decoration: none; 
    font-weight: 600; 
}

/* Zero State Styling */
.zero-state { 
    text-align: center; 
    padding: 60px 20px; 
    color: #7f8c8d; 
}
.zero-state h2 { color: #2c3e50; }

/* API Key Page Specifics */
.import-export-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 30px; 
    margin-top: 20px; 
}

.create-form { 
    background: #f8f9fa; 
    padding: 25px; 
    border-radius: 12px; 
    margin-bottom: 35px; 
    display: flex;
    gap: 15px;
    align-items: center;
}
.create-form input[type="text"] { 
    flex: 1; 
    margin-right: 0; /* Handled by gap */
}
.create-form h3 { margin: 0 0 15px; width: 100%; }

.key-card { 
    border: 1px solid #f1f4f6; 
    border-radius: 10px; 
    padding: 20px; 
    margin-bottom: 15px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    transition: transform 0.2s, box-shadow 0.2s;
}
.key-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    border-color: #3498db;
}
.key-info code { 
    background: #fff5f5; 
    padding: 8px 12px; 
    border-radius: 8px; 
    color: #e74c3c; 
    font-size: 13px; 
    display: block; 
    margin: 10px 0;
    border: 1px solid #fed7d7;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    word-break: break-all;
    line-height: 1.4;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    body { padding: 15px 10px; }
    .container { padding: 25px 20px; border-radius: 8px; }
    .header-section { flex-direction: column; gap: 15px; text-align: center; align-items: center; }
    .user-info { text-align: center; }
    .nav { justify-content: center; gap: 10px; }
    .nav a { flex: 1; text-align: center; min-width: 120px; }
    table { display: block; overflow-x: auto; width: 100%; white-space: nowrap; }
    .import-export-grid { grid-template-columns: 1fr; gap: 20px; }
    .key-card { flex-direction: column; align-items: flex-start; gap: 15px; }
    .key-actions { width: 100%; }
    .key-actions .btn { width: 100%; }
}

@media (max-width: 480px) {
    h1 { font-size: 1.4rem; }
    .container { padding: 25px 15px; }
    .btn { padding: 10px 15px; font-size: 13px; }
    .nav a { min-width: calc(50% - 10px); font-size: 12px; padding: 10px 5px; }
    .create-form { flex-direction: column; }
    .create-form input { width: 100%; }
}

