
/*
Palette (light):
#000000, #5935DB, #0D73E0, #6ED3F5, #A238DC, #3569E0
For dark theme we use darker navy versions of purple/blue.
*/

/* Base */
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* -------- LIGHT THEME -------- */
.theme-light.public-body {
    background: #f5f6ff;
    color: #111827;
}

.theme-light .topbar {
    background: linear-gradient(90deg, #0D73E0, #6ED3F5);
    border-bottom: 1px solid rgba(15,23,42,0.12);
    box-shadow: 0 4px 12px rgba(15,23,42,0.25);
}

.theme-light .logo-text {
    color: #ffffff;
}

.theme-light .nav-link {
    color: #0b1b3b;
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

.theme-light .nav-link:hover {
    background: rgba(255,255,255,0.9);
    color: #0D73E0;
    border-color: #0D73E0;
}

.theme-light .nav-link.active {
    background: linear-gradient(135deg, #5935DB, #A238DC);
    color: #ffffff;
    border-color: transparent;
}

.theme-light .page-content {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(15,23,42,0.12);
    box-shadow: 0 18px 40px rgba(15,23,42,0.18);
}

.theme-light .footer {
    background: #e6ebff;
    border-top: 1px solid rgba(15,23,42,0.12);
    color: #374151;
}

.theme-light.auth-body {
    background: radial-gradient(circle at top, #e6ebff, #c4d4ff);
}

.theme-light .auth-card {
    background: #ffffff;
    border: 1px solid rgba(15,23,42,0.12);
    box-shadow: 0 18px 40px rgba(15,23,42,0.25);
}

.theme-light.admin-body {
    background: #eef1ff;
}

.theme-light .admin-header {
    background: #ffffff;
    border-bottom: 1px solid rgba(15,23,42,0.12);
}

.theme-light .admin-sidebar {
    background: #ffffff;
    border-right: 1px solid rgba(15,23,42,0.12);
}

.theme-light .admin-table th {
    color: #111827;
}

.theme-light .admin-table td {
    border-bottom-color: rgba(15,23,42,0.08);
}

.theme-light .admin-table tr:hover td {
    background: rgba(15,23,42,0.04);
}

.theme-light input[type="text"],
.theme-light input[type="password"],
.theme-light textarea,
.theme-light select {
    background: #ffffff;
    border-color: rgba(15,23,42,0.2);
    color: #111827;
}

/* -------- DARK THEME -------- */
.theme-dark.public-body {
    background: #050618;
    color: #f9fafb;
}

.theme-dark .topbar {
    background: linear-gradient(90deg, #020310, #12163a);
    border-bottom: 1px solid rgba(148,163,184,0.25);
    box-shadow: 0 8px 22px rgba(0,0,0,0.8);
}

.theme-dark .logo-text {
    color: #f9fafb;
}

.theme-dark .nav-link {
    color: #e5e7ff;
    background: rgba(2,6,23,0.75);
    border-color: rgba(129,140,248,0.5);
}

.theme-dark .nav-link:hover {
    background: linear-gradient(135deg, #3569E0, #0D73E0);
    border-color: #6ED3F5;
}

.theme-dark .nav-link.active {
    background: linear-gradient(135deg, #5935DB, #A238DC);
    color: #ffffff;
    border-color: transparent;
}

.theme-dark .page-content {
    background: radial-gradient(circle at top left, rgba(53,105,224,0.18), rgba(0,0,0,0.85));
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,0.35);
    box-shadow: 0 18px 45px rgba(0,0,0,0.9);
}

.theme-dark .footer {
    background: #020310;
    border-top: 1px solid rgba(148,163,184,0.3);
    color: #9ca3af;
}

.theme-dark.auth-body {
    background: radial-gradient(circle at top, #111827, #020310);
}

.theme-dark .auth-card {
    background: #020310;
    border: 1px solid rgba(129,140,248,0.4);
    box-shadow: 0 18px 50px rgba(0,0,0,0.9);
}

.theme-dark.admin-body {
    background: #020310;
    color: #f9fafb;
}

.theme-dark .admin-header {
    background: #020310;
    border-bottom: 1px solid rgba(148,163,184,0.3);
}

.theme-dark .admin-sidebar {
    background: #050618;
    border-right: 1px solid rgba(148,163,184,0.3);
}

.theme-dark .admin-table tr:hover td {
    background: rgba(15,23,42,0.7);
}

.theme-dark input[type="text"],
.theme-dark input[type="password"],
.theme-dark textarea,
.theme-dark select {
    background: #020617;
    border-color: rgba(148,163,184,0.6);
    color: #e5e7eb;
}

/* Shared public layout */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 64px;
    width: auto;
    border-radius: 10px;
}

.logo-text {
    font-weight: 800;
    letter-spacing: 0.08em;
    font-size: 1rem;
    text-transform: uppercase;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.nav-link {
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    font-size: 0.9rem;
    text-decoration: none;
    border-width: 1px;
    border-style: solid;
    box-shadow: 0 6px 18px rgba(15,23,42,0.35);
    transition: all 0.15s ease-out;
}

.nav-link:active {
    transform: translateY(1px) scale(0.98);
}

.content {
    max-width: 1200px;
    margin: 1.6rem auto 2.6rem;
    padding: 0 1rem;
}

.page-content {
    padding: 1.8rem;
}

.footer {
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
}

/* Auth */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}

.auth-card {
    border-radius: 16px;
    padding: 1.6rem 1.8rem 1.8rem;
}

.auth-card h1 {
    margin-top: 0;
    font-size: 1.3rem;
}

label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

input[type="text"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    border: 1px solid rgba(148,163,184,0.6);
    background: #020617;
    color: #f9fafb;
    font-size: 0.9rem;
    box-sizing: border-box;
}

textarea {
    resize: vertical;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #5935DB, #A238DC);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 8px 22px rgba(76,29,149,0.6);
}

.btn-primary:hover {
    filter: brightness(1.06);
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(148,163,184,0.9);
    color: inherit;
}

.btn-secondary:hover {
    background: rgba(148,163,184,0.12);
}

.alert {
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    font-size: 0.8rem;
    margin-bottom: 0.9rem;
}

.alert-error {
    background: rgba(248,113,113,0.12);
    border: 1px solid rgba(248,113,113,0.7);
}

.alert-success {
    background: rgba(52,211,153,0.12);
    border: 1px solid rgba(52,211,153,0.7);
}

.alert-info {
    background: rgba(59,130,246,0.12);
    border: 1px solid rgba(59,130,246,0.7);
}

/* Admin layout */
.admin-body {
    min-height: 100vh;
}

.admin-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.admin-logo-mini {
    width: 26px;
    height: 26px;
    border-radius: 9px;
    background: linear-gradient(135deg, #0D73E0, #6ED3F5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #020617;
}

.admin-layout {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 230px 1fr;
    min-height: calc(100vh - 52px);
}

.admin-sidebar {
    padding: 1rem;
}

.admin-sidebar nav a {
    display: block;
    padding: 0.5rem 0.7rem;
    margin-bottom: 0.35rem;
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 7px;
    color: inherit;
}

.admin-sidebar nav a.active,
.admin-sidebar nav a:hover {
    background: rgba(13,115,224,0.12);
    color: inherit;
}

.admin-main {
    padding: 1.2rem 1.2rem 2rem;
}

.admin-main h1 {
    margin-top: 0;
    font-size: 1.25rem;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid rgba(148,163,184,0.4);
    padding: 0.45rem 0.4rem;
}

.admin-table th {
    text-align: left;
    font-weight: 600;
}

/* Small buttons in tables */
.btn-table {
    display: inline-block;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.9);
    font-size: 0.75rem;
    text-decoration: none;
    color: inherit;
    margin-right: 0.25rem;
    background: transparent;
}

.btn-table:hover {
    background: rgba(59,130,246,0.16);
    border-color: rgba(59,130,246,0.9);
}

.btn-table-danger {
    border-color: rgba(248,113,113,0.9);
}

.btn-table-danger:hover {
    background: rgba(248,113,113,0.16);
}

/* Logo settings box */
.logo-settings {
    border: 1px dashed rgba(148,163,184,0.7);
    border-radius: 10px;
    padding: 0.7rem 0.8rem 0.9rem;
    margin-bottom: 1rem;
}

.theme-light .logo-settings {
    border-color: rgba(15,23,42,0.25);
}

.logo-settings legend {
    font-size: 0.85rem;
    padding: 0 0.3rem;
}

.logo-preview-row {
    margin-bottom: 0.5rem;
}

.logo-preview {
    max-height: 90px;
    width: auto;
    border-radius: 10px;
    border: 1px solid rgba(148,163,184,0.8);
}

.theme-light .logo-preview {
    border-color: rgba(15,23,42,0.3);
}

/* Editor */
.editor-mode-switch {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.8rem;
    margin: 0.4rem 0 0.5rem;
}

.editor-mode-switch label {
    margin-bottom: 0;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}

.editor-toolbar button {
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.8);
    background: transparent;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
}

.editor-toolbar button:hover {
    background: rgba(59,130,246,0.16);
}

.visual-editor {
    min-height: 260px;
    border-radius: 10px;
    border: 1px solid rgba(148,163,184,0.7);
    padding: 0.6rem 0.7rem;
    margin-bottom: 0.6rem;
    background: rgba(15,23,42,0.04);
    overflow-y: auto;
}

.theme-dark .visual-editor {
    background: #020617;
}

.html-label textarea {
    margin-top: 0.3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .admin-layout {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        border-bottom: 1px solid rgba(148,163,184,0.4);
    }
}
