:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --text: #f8fafc;
    --text-dim: #94a3b8;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --sidebar-width: 260px;
    --border: rgba(255, 255, 255, 0.08);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 30px 24px;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item:hover, .nav-item.active {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
}

.nav-item i {
    margin-right: 12px;
    font-size: 18px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px;
}

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

.page-title {
    font-size: 24px;
    font-weight: 700;
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--surface);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.stat-label {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 8px;
}

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

/* Data Tables */
.card {
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

th, td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: rgba(255, 255, 255, 0.02);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}

tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid var(--border);
}

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

/* Status Pills */
.status-badge {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-publish { background: rgba(34, 197, 94, 0.1); color: #4ade80; }
.status-draft { background: rgba(148, 163, 184, 0.1); color: #94a3b8; }

/* Form Styles */
.form-group {
    margin-bottom: 24px;
}

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
}

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

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

/* Social Icon Inputs */
.social-input-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Icon Picker */
.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: #0f172a;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.icon-option {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* Added for absolute children alignment */
    overflow: hidden; /* Prevent overflow */
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.2s;
}

.icon-option:hover, .icon-option.selected {
    border-color: var(--primary);
    background: rgba(56, 189, 248, 0.1);
}

.icon {
    display: inline-block;
    width: 128px;
    height: 128px;
    background-repeat: no-repeat;
    background-size: auto;
}

.icon-option .icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 128px;  /* Ensure base size */
    height: 128px; /* Ensure base size */
    transform: translate(-50%, -50%) scale(0.35);
    transform-origin: center center;
}

#selected-icon-preview .icon {
    transform: scale(0.6);
}

/* Steps Editor */
.sections-editor {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 12px;
    position: relative;
    display: flex;
    gap: 20px;
}

.section-item-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--danger);
    cursor: pointer;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.tab {
    padding: 12px 0;
    color: var(--text-dim);
    cursor: pointer;
    font-weight: 600;
    position: relative;
}

.tab.active {
    color: var(--primary);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
}
