:root {
    --brand-purple: #a855f7;
    --brand-purple-dark: #7c3aed;
    --bg-dark: #0d1117;
    --bg-medium: #161b22;
    --bg-light: #21262d;
    --border-color: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
}

body { 
    font-family: 'Sarabun', sans-serif; 
    color: var(--text-primary);
    background-color: var(--bg-dark);
    overflow: hidden; /* Hide scrollbars from animated bg */
}

.main-container {
    position: relative;
    z-index: 1;
    height: 100vh;
    overflow-y: auto;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(ellipse at 20% 80%, rgba(139, 92, 246, 0.15), transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(59, 130, 246, 0.15), transparent 50%),
        radial-gradient(ellipse at 90% 90%, rgba(217, 70, 239, 0.15), transparent 50%);
    animation: move-glow 25s linear infinite;
    z-index: 0;
}
@keyframes move-glow {
    0% { background-position: 0% 50%, 50% 0%, 90% 90%; }
    50% { background-position: 100% 50%, 50% 100%, 0% 0%; }
    100% { background-position: 0% 50%, 50% 0%, 90% 90%; }
}


.font-display { font-family: 'Playfair Display', serif; }
.xgl-purple { color: var(--brand-purple); }

.btn { 
    position: relative;
    overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; padding: 0.75rem 1.5rem; border-radius: 0.5rem; font-weight: 600; transition: all 0.3s ease; cursor: pointer;
}
.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.875rem; }
.btn:disabled { cursor: not-allowed; opacity: 0.5; }
.btn-primary { background-color: var(--brand-purple); color: white; border: 1px solid rgba(255, 255, 255, 0.2); }
.btn-primary:hover:not(:disabled) { background-color: var(--brand-purple-dark); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(167, 139, 250, 0.1); }
.btn-primary:active:not(:disabled) { transform: translateY(-1px) scale(0.98); }
.btn-secondary { background-color: var(--bg-light); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover:not(:disabled) { background-color: var(--border-color); }
.btn-danger { background-color: #dc2626; color: white; border: 1px solid rgba(255, 255, 255, 0.2); }
.btn-danger:hover:not(:disabled) { background-color: #b91c1c; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(239, 68, 68, 0.1); }
.btn-danger:active:not(:disabled) { transform: translateY(-1px) scale(0.98); }

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}
.btn:hover::after {
    left: 150%;
}

.form-input, .form-select, .form-textarea { background-color: var(--bg-light); border: 1px solid var(--border-color); color: var(--text-primary); border-radius: 0.375rem; padding: 0.75rem 1rem; transition: all 0.2s ease; width: 100%; }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--brand-purple); box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2), 0 0 15px rgba(168, 85, 247, 0.2) inset; }
.form-input:disabled { background-color: var(--bg-medium); color: var(--text-secondary); cursor: not-allowed; }
.form-display { background-color: var(--bg-medium); border: 1px solid var(--border-color); color: var(--text-primary); border-radius: 0.375rem; padding: 0.75rem 1rem; width: 100%; min-height: 46px; }

.fade-in { animation: fadeIn 0.5s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.portal-menu-item { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; border-radius: 0.75rem; background-color: var(--bg-medium); border: 1px solid var(--border-color); color: var(--text-secondary); font-weight: 500; transition: all 0.2s ease-in-out; cursor: pointer; text-align: center; position: relative; }
.portal-menu-item:hover { background-color: var(--bg-light); color: white; transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); border-color: var(--brand-purple); }
.portal-menu-item.active { background-color: #3b0764; border-color: var(--brand-purple); color: white; }
.notification-dot { position: absolute; top: 0.5rem; right: 0.5rem; width: 0.75rem; height: 0.75rem; background-color: #f85149; border-radius: 9999px; border: 2px solid var(--bg-medium); }
.notification-badge { position: absolute; top: 0.5rem; right: 0.5rem; min-width: 1.25rem; height: 1.25rem; padding: 0 0.25rem; background-color: #f85149; border-radius: 9999px; border: 2px solid var(--bg-medium); color: white; font-size: 0.75rem; display: flex; align-items: center; justify-content: center; }

.modal-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(13, 17, 23, 0.8); backdrop-filter: blur(5px); z-index: 40; opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
.modal-backdrop.active { opacity: 1; pointer-events: auto; }
.modal-content { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.95); z-index: 50; transition: transform 0.3s ease, opacity 0.3s ease; opacity: 0; pointer-events: none; background-color: var(--bg-medium); border: 1px solid var(--border-color); }
.modal-content.active { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }

.toast-notification { position: fixed; bottom: 2rem; right: 2rem; padding: 1rem 1.5rem; border-radius: 0.5rem; color: white; z-index: 100; opacity: 0; transform: translateY(20px); transition: all 0.3s ease-in-out; background-color: var(--bg-light); border: 1px solid var(--border-color); }
.toast-success { background-color: #238636; border-color: #2ea043; }
.toast-error { background-color: #da3633; border-color: #f85149; }

.glass-pane { background-color: rgba(22, 27, 34, 0.7); backdrop-filter: blur(10px); border: 1px solid var(--border-color); }

.loading-spinner {
    border: 4px solid var(--border-color);
    border-top-color: var(--brand-purple);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
#portal-content-area {
    margin-top: 12px;
}

/* Portal menu size adjustments */
.portal-menu-item {
    min-height: 100px !important;
    padding: 0.75rem !important;
}

.portal-menu-item div:first-child {
    font-size: 1.75rem !important;
    margin-bottom: 0.375rem !important;
}

.portal-menu-item div:last-child {
    font-size: 0.8rem !important;
}

#portal-content-area {
    margin-top: 12px;
}

#portal-content-area {
    margin-top: 12px;
}

