/* Login - Login View, User Info, Snapshot Mode */

/* Login View */
.login-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0d0a1f 0%, #000B42 50%, #1a1538 100%);
    color: white;
    position: relative;
    overflow: hidden;
}
.login-view::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(119,95,255,0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(82,51,255,0.1) 0%, transparent 50%);
    animation: pulse-bg 8s ease-in-out infinite;
}
@keyframes pulse-bg {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}
.login-card {
    background: rgba(255,255,255,0.98);
    border-radius: 24px;
    padding: 48px 56px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 80px rgba(119,95,255,0.2);
    max-width: 440px;
    position: relative;
    z-index: 1;
}
.login-logo {
    margin-bottom: 32px;
}
.login-logo svg {
    height: 48px;
    width: auto;
}
.login-logo-text {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}
.login-logo-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}
.login-card h1 {
    color: var(--text-primary);
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 600;
}
.login-card p {
    color: var(--text-secondary);
    margin: 0 0 32px;
    font-size: 0.95rem;
}
.login-card .login-btn {
    background: #2f2f2f;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    justify-content: center;
}
.login-card .login-btn:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.login-card .login-btn svg {
    width: 20px;
    height: 20px;
}
.login-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.login-divider::before, .login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--light-border);
}
.login-divider span {
    padding: 0 16px;
}
.login-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--light-border);
    font-size: 0.8rem;
    color: var(--text-muted);
}
.login-footer a {
    color: var(--primary);
    text-decoration: none;
}
.login-footer a:hover {
    text-decoration: underline;
}

/* User info in header */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}
.user-name {
    font-size: 0.9rem;
    opacity: 0.9;
}
.header-select {
    background: rgba(255,255,255,0.12);
    color: white;
    border: 1px solid rgba(255,255,255,0.25);
    padding: 5px 8px;
    border-radius: 4px;
    min-width: 130px;
    cursor: pointer;
    font-size: 0.8rem;
}
.header-select option {
    background: var(--light-card);
    color: #1a1a2e;
}

/* Expandable Pages */
.pages-container {
    max-height: 500px;
    overflow-y: auto;
}
/* Page Tree - File Explorer Style */
.page-expandable {
    position: relative;
}
.page-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 4px;
    margin-bottom: 2px;
}
.page-header:hover {
    background: rgba(119,95,255,0.08);
}
.page-header .expand-icon {
    transition: transform 0.2s;
    color: var(--text-muted);
    font-size: 10px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.page-expandable.expanded .page-header .expand-icon {
    transform: rotate(90deg);
}
.page-sections {
    display: none;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--light-border);
}
.page-expandable.expanded .page-sections {
    display: block;
}
/* Section items in tree */
.section-item {
    padding: 5px 10px;
    margin-bottom: 2px;
    border-radius: 4px;
    transition: background 0.15s;
}
.section-item:hover {
    background: rgba(119,95,255,0.06);
}
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title {
    font-weight: 500;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.section-category {
    font-size: 11px;
    color: var(--primary);
    margin-top: 2px;
}
.section-summary {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}
.section-models {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* ========== Read-Only / Snapshot Mode ========== */
.read-only-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(90deg, #fef3cd 0%, #fff8e6 100%);
    border-bottom: 1px solid #ffc107;
    color: #856404;
    font-size: 0.9rem;
}

.snapshot-mode .workspace-action-btn:disabled,
.snapshot-mode .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-select-snapshot.snapshot-active {
    background: linear-gradient(135deg, #775FFF 0%, #a18aff 100%);
    color: white;
    border-color: var(--primary);
    font-weight: 600;
}

.nav-select-snapshot.snapshot-active option {
    background: var(--light-card);
    color: var(--text-primary);
}

/* Hide edit buttons in snapshot mode */
.snapshot-mode .edit-only {
    display: none !important;
}

/* Dim interactive elements in snapshot mode */
.snapshot-mode .workspace-item:hover .item-actions,
.snapshot-mode .tree-node:hover .node-actions {
    opacity: 0.3;
    pointer-events: none;
}

/* Read-only badge for vocabulary */
.vocab-readonly-badge {
    background: #f0f0f0;
    color: #666;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-left: 8px;
}

/* Snapshot indicator pulse */
@keyframes snapshot-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(119, 95, 255, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(119, 95, 255, 0); }
}

.nav-select-snapshot.snapshot-active {
    animation: snapshot-pulse 2s infinite;
}

/* ========== Dark Mode Overrides ========== */
:root.dark-mode .login-card {
    background: rgba(26, 23, 56, 0.95);
    color: var(--text-primary);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 80px rgba(140,122,255,0.3);
}

:root.dark-mode .login-card h1 {
    color: var(--text-primary);
}

:root.dark-mode .login-card p {
    color: var(--text-secondary);
}

:root.dark-mode .login-logo-subtitle {
    color: var(--text-secondary);
}

:root.dark-mode .login-card .login-btn {
    background: #3a3a3a;
}

:root.dark-mode .login-card .login-btn:hover {
    background: #2a2a2a;
}

:root.dark-mode .login-footer {
    border-top-color: var(--light-border);
    color: var(--text-muted);
}

:root.dark-mode .login-divider::before,
:root.dark-mode .login-divider::after {
    background: var(--light-border);
}
