/* Global Reset & Base Variables */
:root {
    --bg-dark: #090a0f;
    --bg-card: rgba(17, 20, 32, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --primary-color: #6366f1;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    font-family: var(--font-sans);
    color: var(--text-primary);
    overflow: hidden;
}

/* App Container Layout */
.app-container {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 40%);
}

/* Password Lock Screen */
.lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #11131c 0%, #06070a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.lock-screen.unlocked {
    opacity: 0;
    pointer-events: none;
}

.lock-card {
    background: rgba(17, 20, 32, 0.65);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 20px;
    width: 420px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(99, 102, 241, 0.1);
}

.lock-icon {
    font-size: 48px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.4));
    animation: pulse 2s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

.lock-card h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lock-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 28px;
}

.input-group {
    display: flex;
    gap: 10px;
    width: 100%;
}

#password-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

#password-input:focus {
    border-color: var(--primary-color);
}

.btn-unlock {
    padding: 12px 24px;
}

.error-msg {
    color: #ef4444 !important;
    font-size: 13px !important;
    margin-top: 16px;
    margin-bottom: 0 !important;
    font-weight: 500;
}

/* Glassmorphic Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    padding: 0 24px;
    background: rgba(9, 10, 15, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5));
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-kiro {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1.5px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.doc-badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #a855f7;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.icon {
    width: 16px;
    height: 16px;
}

/* Workspace Split */
.workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: rgba(13, 14, 22, 0.4);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    overflow-y: auto;
}

.sidebar-section h3 {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.meta-list {
    list-style: none;
}

.meta-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.meta-list li:last-child {
    border-bottom: none;
}

.meta-list .label {
    font-size: 14px;
    color: var(--text-secondary);
}

.meta-list .val {
    font-size: 14px;
    font-weight: 500;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px !important;
}

.badge-sec {
    padding: 4px 8px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.security-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.security-features li {
    display: flex;
    gap: 14px;
}

.feat-icon {
    font-size: 20px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    height: fit-content;
}

.security-features h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.security-features p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.sidebar-footer {
    margin-top: auto;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.2);
    text-align: center;
}

/* PDF Viewer Container */
.viewer-container {
    flex: 1;
    padding: 24px;
    background: rgba(9, 10, 15, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.iframe-wrapper {
    width: 100%;
    height: 100%;
    background: rgba(17, 20, 32, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

iframe {
    border: none;
}

/* Responsive adjustment */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
}
