/* === Oracle Portal CSS === */

/* === Custom Properties === */
:root {
    --primary: #C9A84C;
    --primary-glow: rgba(201, 168, 76, 0.4);
    --bg: #0a0a0a;
    --bg-light: #111111;
    --bg-lighter: #1a1a1a;
    --text: #f0ede6;
    --text-muted: #a09b90;
    --error: #e53e3e;
    --success: #38a169;
    --warning: #ed8936;
    --font-display: 'Cinzel', Georgia, serif;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* === Reset === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* === Base === */
html {
    font-size: 16px;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

/* === Oracle Layout === */
.oracle-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

/* === Oracle Sidebar === */
.oracle-sidebar {
    background-color: var(--bg-light);
    border-right: 1px solid rgba(201, 168, 76, 0.2);
    padding: 2rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.oracle-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.oracle-brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.oracle-badge {
    display: inline-block;
    background-color: var(--primary);
    color: var(--bg);
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    margin-left: auto;
    font-weight: 700;
}

/* === Sidebar Navigation === */
.oracle-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.oracle-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    color: var(--text-muted);
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.oracle-nav-item:hover {
    background-color: var(--bg-lighter);
    color: var(--primary);
    text-decoration: none;
}

.oracle-nav-item.active {
    background-color: var(--primary);
    color: var(--bg);
}

.oracle-nav-icon {
    font-size: 1.2rem;
}

/* === Sidebar Footer === */
.oracle-sidebar-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(201, 168, 76, 0.2);
}

.oracle-sidebar-user {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-logout {
    padding: 0.5rem 1rem;
    background-color: var(--error);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s ease;
}

.btn-logout:hover {
    background-color: #c92a2a;
}

/* === Oracle Main === */
.oracle-main {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.oracle-header {
    background-color: var(--bg-light);
    border-bottom: 1px solid rgba(201, 168, 76, 0.2);
    padding: 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.oracle-header h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--primary);
}

.oracle-content {
    padding: 2rem;
    flex: 1;
}

/* === Forms === */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--bg-lighter);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 4px;
    color: var(--text);
    font-family: var(--font-stack);
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

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

.form-help {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.field-error {
    display: block;
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.char-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    float: right;
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-stack);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

.btn-primary:hover {
    background-color: #d4b55f;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-secondary:hover {
    background-color: rgba(201, 168, 76, 0.1);
}

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

.btn-danger:hover {
    background-color: #c92a2a;
}

.btn-block {
    width: 100%;
}

/* === Alerts === */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-danger {
    background-color: rgba(229, 62, 62, 0.1);
    border: 1px solid var(--error);
    color: #ff6b6b;
}

.alert-success {
    background-color: rgba(56, 161, 105, 0.1);
    border: 1px solid var(--success);
    color: #51cf66;
}

.alert-warning {
    background-color: rgba(237, 137, 54, 0.1);
    border: 1px solid var(--warning);
    color: #ffa94d;
}

/* === Stat Cards === */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-lighter);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 4px;
    padding: 1.5rem;
    text-align: center;
}

.stat-card .stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === Status Badge === */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.online {
    background-color: rgba(56, 161, 105, 0.15);
    color: #51cf66;
    border: 1px solid rgba(56, 161, 105, 0.3);
}

.status-badge.offline {
    background-color: rgba(160, 155, 144, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(160, 155, 144, 0.3);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-badge.online .status-dot {
    background-color: #51cf66;
}

.status-badge.offline .status-dot {
    background-color: var(--text-muted);
}

/* === Toggle Switch === */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid rgba(201, 168, 76, 0.2);
    background-color: var(--bg-lighter);
    color: var(--text);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.toggle-switch:hover {
    border-color: var(--primary);
}

.toggle-track {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background-color: rgba(160, 155, 144, 0.3);
    position: relative;
    transition: background-color 0.2s ease;
}

.toggle-switch.active .toggle-track {
    background-color: var(--success);
}

.toggle-knob {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
}

.toggle-switch.active .toggle-knob {
    transform: translateX(20px);
}

/* === Avatar Preview === */
.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary);
    margin-bottom: 1rem;
    background-color: var(--bg-lighter);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.avatar-placeholder {
    font-size: 3rem;
    color: var(--text-muted);
}

.avatar-upload {
    display: none;
}

/* === Login Page === */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg);
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.login-card {
    background-color: var(--bg-lighter);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 8px;
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.register-card {
    max-width: 520px;
}

.login-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    display: block;
    object-fit: contain;
}

.login-title {
    font-family: var(--font-display);
    font-size: 2rem;
    text-align: center;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-footer {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* === Current Rate Display === */
.current-rate {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--primary);
    text-align: center;
    padding: 2rem;
    background-color: var(--bg-lighter);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 4px;
    margin-bottom: 2rem;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.95rem;
    max-width: 400px;
    margin: 0 auto;
}

/* === Token Error Page === */
.token-error {
    text-align: center;
    padding: 4rem 2rem;
}

.token-error h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.token-error p {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

/* === Tables === */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background-color: var(--bg-lighter);
    border-radius: 4px;
    overflow: hidden;
}

.table thead {
    background-color: var(--bg-light);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid rgba(201, 168, 76, 0.2);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(201, 168, 76, 0.1);
}

/* === Disclaimer === */
.disclaimer {
    text-align: center;
    padding: 1rem 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid rgba(201, 168, 76, 0.1);
}

/* === Inline === */
.inline {
    display: inline;
}

/* === Responsive === */
@media (max-width: 768px) {
    .oracle-layout {
        grid-template-columns: 1fr;
    }

    .oracle-sidebar {
        display: none;
    }

    .oracle-header {
        padding: 1.5rem;
    }

    .oracle-header h1 {
        font-size: 1.5rem;
    }

    .oracle-content {
        padding: 1rem;
    }

    .login-card,
    .register-card {
        padding: 2rem;
        margin: 1rem;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .current-rate {
        font-size: 2rem;
    }
}
