/* public/css/style.css */

/* Reset foarte light */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body.app-body {
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #05070b;
    color: #f5f5f5;
}

/* Header */

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: radial-gradient(circle at top left, #1e293b, #020617);
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    position: sticky;
    top: 0;
    z-index: 20;
}

.app-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-circle {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #020617, #0f172a);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.app-title-group {
    display: flex;
    flex-direction: column;
}

.app-title {
    font-size: 1.1rem;
    margin: 0;
}

.app-subtitle {
    font-size: 0.8rem;
    color: #9ca3af;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* User pill */

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.4);
    font-size: 0.85rem;
}

.user-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}

/* Layout */

.app-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: calc(100vh - 56px);
}

/* Sidebar */

.sidebar {
    background: linear-gradient(180deg, #020617, #020617 40%, #020617 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.25);
    padding: 1rem 0.75rem;
    position: relative;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.35rem;
    text-decoration: none;
    color: #cbd5f5;
    font-size: 0.9rem;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.sidebar-link:hover {
    background: rgba(30, 64, 175, 0.35);
    color: #ffffff;
    transform: translateX(1px);
}

.sidebar-link.is-active {
    background: rgba(37, 99, 235, 0.9);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.7);
}

/* Sidebar toggle (mobil) */

.sidebar-toggle {
    display: none;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    border: none;
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
}

/* Main content */

.main-content {
    padding: 1.25rem 1.5rem 2rem;
    max-width: 1200px;
    width: 100%;
}

/* Cards */

.card {
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.9));
    border-radius: 0.75rem;
    padding: 1.1rem 1.25rem 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
    margin-bottom: 1rem;
}

.card-narrow {
    max-width: 480px;
    margin-inline: auto;
}

.card-title {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}

.card p {
    margin: 0 0 0.8rem;
    color: #d1d5db;
    font-size: 0.9rem;
}

/* Card grid stats */

.card-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-top: 0.75rem;
}

.card-stat {
    padding: 0.8rem 0.9rem;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.stat-note {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.9rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border-color: rgba(191, 219, 254, 0.7);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.7);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.8);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.6);
}

.btn-ghost:hover {
    background: rgba(15, 23, 42, 0.9);
}

.btn-small {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
}

/* Forms */

form {
    margin-top: 0.5rem;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 0.4rem 0.55rem;
    border-radius: 0.4rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
    font-size: 0.9rem;
}

input::placeholder {
    color: #6b7280;
}

/* Footer */

.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    background: #020617;
    font-size: 0.8rem;
    color: #6b7280;
}

.footer-right {
    opacity: 0.85;
}

/* Responsive */

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

    .sidebar {
        position: sticky;
        top: 56px;
        z-index: 10;
        padding-top: 2.2rem;
    }

    .sidebar-toggle {
        display: inline-block;
    }

    .sidebar-nav {
        display: none;
    }

    .sidebar-nav.is-open {
        display: flex;
    }
}
/* Debug panel (development only) */

.debug-panel {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    max-width: 320px;
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(248, 250, 252, 0.2);
    font-size: 0.75rem;
    color: #e5e7eb;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.9);
    z-index: 50;
}

.debug-title {
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
}

.debug-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.debug-row span {
    color: #9ca3af;
}

.debug-row code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Extra spacing utility */
.card-spacing-top {
    margin-top: 1rem;
}

/* Debug panel (development only) */

.debug-panel {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    max-width: 320px;
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(248, 250, 252, 0.2);
    font-size: 0.75rem;
    color: #e5e7eb;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.9);
    z-index: 50;
}

.debug-title {
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
}

.debug-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.debug-row span {
    color: #9ca3af;
}

.debug-row code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Characters page */

.characters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.card-subtitle {
    margin: 0;
    font-size: 0.85rem;
    color: #9ca3af;
}

.characters-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 0.75rem;
}

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

.characters-table th,
.characters-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    text-align: left;
}

.characters-table th {
    font-weight: 600;
    color: #e5e7eb;
    background: rgba(15, 23, 42, 0.9);
}

.characters-table tr:hover td {
    background: rgba(15, 23, 42, 0.6);
}

.characters-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

/* Badges */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
    border: 1px solid transparent;
}

.badge-main {
    border-color: rgba(74, 222, 128, 0.7);
    background: rgba(22, 163, 74, 0.2);
    color: #bbf7d0;
}

.badge-secondary {
    border-color: rgba(59, 130, 246, 0.6);
    background: rgba(37, 99, 235, 0.15);
    color: #bfdbfe;
}

.badge-muted {
    border-color: rgba(148, 163, 184, 0.6);
    background: rgba(31, 41, 55, 0.9);
    color: #e5e7eb;
}

/* Secondary button */

.btn-secondary {
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.8);
}

.btn-secondary:hover {
    background: rgba(30, 64, 175, 0.9);
    border-color: rgba(191, 219, 254, 0.9);
}


/* Characters page main card */

.character-main-card {
    border-left: 3px solid rgba(59, 130, 246, 0.9);
}

/* Admin section */

.admin-characters-grid {
    margin-top: 0.75rem;
}

.admin-character-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-char-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.admin-char-name {
    font-size: 1rem;
    font-weight: 600;
    color: #e5e7eb;
}

.admin-char-id {
    font-size: 0.75rem;
    color: #9ca3af;
}

.admin-char-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
}

.admin-char-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.admin-char-row .stat-label {
    font-size: 0.8rem;
    color: #9ca3af;
}

.admin-char-row .stat-value {
    font-size: 0.8rem;
    color: #e5e7eb;
    text-align: right;
}

/* Pagination */

.pagination {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    color: #e5e7eb;
    background: rgba(15, 23, 42, 0.9);
}

.page-link:hover {
    border-color: rgba(191, 219, 254, 0.9);
}

.page-link.is-current {
    background: rgba(37, 99, 235, 0.95);
    border-color: rgba(191, 219, 254, 0.9);
    font-weight: 600;
}
