:root {
    --bg-dark: #050508;
    --card-bg: rgba(20, 22, 35, 0.4);
    --card-border: rgba(0, 255, 204, 0.2);
    --neon-cyan: #00ffcc;
    --neon-gold: #ffd700;
    --text-primary: #e0e5ff;
    --text-secondary: #8b92b3;
    --font-sans: 'Inter', 'Noto Sans SC', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Ambient Background & Glow Orbs */
.ambient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 10%, rgba(0, 255, 204, 0.05) 0%, transparent 60%),
                radial-gradient(circle at 80% 80%, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
    z-index: -2;
}

.cudgel-background {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 60vw;
    height: 100vh;
    transform: translate(-50%, -50%);
    background-image: url('cudgel.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.6;
    z-index: -3;
    animation: drift 10s ease-in-out infinite alternate;
}

@keyframes drift {
    0% { transform: translate(-50%, -48%); filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4)); }
    100% { transform: translate(-50%, -52%); filter: drop-shadow(0 0 40px rgba(255, 215, 0, 0.8)); }
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    z-index: -1;
    animation: float 20s infinite alternate linear;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--neon-cyan);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--neon-gold);
    bottom: -50px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(100px, 50px); }
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header (V2) */
header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.brand-logo {
    height: 80px;
    width: 80px; /* Ensure equal width/height for a perfect circle */
    object-fit: cover; /* Use cover if the image isn't perfectly square */
    border-radius: 50%; /* Create the circular mask */
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.4);
    border: 2px solid rgba(255, 215, 0, 0.5); /* Optional: add a subtle gold ring around it */
}

.branding h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ffffff;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

.branding h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pulse {
    width: 6px;
    height: 6px;
    background: #00ffcc;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 8px #00ffcc;
    animation: pulser 2s infinite;
}

@keyframes pulser {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* Main Dashboard Grid */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    flex: 1;
}

.panel {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.panel-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1rem;
}

.panel-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
}

/* Glassmorphism Classes */
.glass-card {
    background: rgba(10, 12, 18, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 255, 204, 0.15);
    border-radius: 12px;
    box-shadow: inset 0 0 20px rgba(0, 255, 204, 0.05), 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Left Panel Input */
.panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

textarea {
    flex: 1;
    width: 100%;
    background: transparent;
    border: none;
    resize: none;
    color: #4ca1af;
    font-size: 1.1rem;
    line-height: 1.8;
    font-family: var(--font-sans);
    outline: none;
}

textarea::placeholder {
    color: rgba(76, 161, 175, 0.5);
}

.panel-footer {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.btn-awaken {
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.8) 0%, rgba(0, 255, 204, 0.8) 100%);
    color: #000;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-awaken:hover {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

/* Right Panel Chat History */
.chat-history {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-bottom: 1rem;
}

.chat-history::-webkit-scrollbar {
    width: 4px;
}
.chat-history::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.message {
    display: flex;
    gap: 1rem;
    animation: fadeIn 0.3s ease forwards;
    align-items: flex-start;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.msg-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.msg-content {
    color: #a0a5b8;
    font-size: 0.95rem;
    line-height: 1.6;
}

.cap-tag {
    display: inline-block;
    color: #ffd700;
    font-weight: 600;
    margin-right: 4px;
}

/* Confirmation Box */
.confirmation-box {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.confirm-content {
    color: #a0a5b8;
    font-size: 0.95rem;
}

.confirm-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-confirm {
    background: transparent;
    border: 1px solid var(--neon-gold);
    color: var(--neon-gold);
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.btn-confirm:hover {
    background: rgba(255, 215, 0, 0.1);
}

.btn-cancel {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Progress Section */
.hidden { display: none !important; }

.progress-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.progress-track {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar-bg {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-gold), var(--neon-cyan));
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

/* Capabilities Overview */
.mt-2 { margin-top: 2rem; }

.capabilities-overview {
    padding: 1.5rem 2rem;
    background: rgba(10, 12, 18, 0.4);
}

.capabilities-overview h2 {
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
}

.cap-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.25rem 1rem;
    border-radius: 8px;
    transition: var(--transition-smooth);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cap-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.cap-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--neon-cyan);
}

.cap-card p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.cap-card:hover {
    transform: translateY(-5px);
    border-color: var(--neon-cyan);
    box-shadow: 0 5px 15px rgba(0, 255, 204, 0.1);
    background: rgba(0, 255, 204, 0.05);
}

/* Footer (V2) */
footer {
    margin-top: auto;
    padding-top: 2rem;
    display: flex;
    justify-content: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
}

.footer-center {
    color: rgba(255, 255, 255, 0.6);
}

.footer-right a {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.footer-right a:hover {
    color: var(--neon-cyan);
}

/* Settings & Modal Styles */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-settings {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.btn-settings:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--neon-gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    transform: rotate(90deg);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: rgba(15, 18, 25, 0.9);
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--neon-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.1);
    padding: 0;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.modal-overlay.hidden .modal-content {
    transform: translateY(20px);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--neon-gold);
    margin: 0;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-close:hover {
    color: #fff;
}

.modal-body {
    padding: 1.5rem;
}

.modal-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--neon-cyan);
}

.form-control {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b92b3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

select.form-control option {
    background: var(--bg-dark);
    color: #fff;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
}

.btn-save {
    background: linear-gradient(135deg, var(--neon-gold), #b8860b);
    color: #000;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-save:hover {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 900px) {
    .dashboard-layout { grid-template-columns: 1fr; }
    header { flex-direction: column; gap: 1rem; align-items: center; text-align: center; }
    .header-left { flex-direction: column; }
    footer { flex-direction: column; gap: 1rem; text-align: center; }
}
