:root {
    --bg: #0b0f19;
    --card: rgba(20, 28, 47, 0.65);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #0284c7;
    --accent-glow: rgba(14, 165, 233, 0.15);
    --accent-bright: #38bdf8;
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --danger: #ef4444;
    --glow-color-1: rgba(14, 165, 233, 0.08);
    --glow-color-2: rgba(16, 185, 129, 0.02);
}

body.theme-blue {
    --accent: #0284c7;
    --accent-glow: rgba(14, 165, 233, 0.15);
    --accent-bright: #38bdf8;
    --glow-color-1: rgba(14, 165, 233, 0.08);
    --glow-color-2: rgba(16, 185, 129, 0.02);
}

body.theme-green {
    --accent: #059669;
    --accent-glow: rgba(16, 185, 129, 0.15);
    --accent-bright: #34d399;
    --glow-color-1: rgba(16, 185, 129, 0.08);
    --glow-color-2: rgba(52, 211, 153, 0.02);
}

body.theme-magenta {
    --accent: #db2777;
    --accent-glow: rgba(219, 39, 119, 0.15);
    --accent-bright: #f472b6;
    --glow-color-1: rgba(219, 39, 119, 0.08);
    --glow-color-2: rgba(244, 114, 182, 0.02);
}

body.theme-orange {
    --accent: #d97706;
    --accent-glow: rgba(217, 119, 6, 0.15);
    --accent-bright: #fbbf24;
    --glow-color-1: rgba(217, 119, 6, 0.08);
    --glow-color-2: rgba(251, 191, 36, 0.02);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    position: relative;
}

/* Glowing Mesh Background */
.glow-bg {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow-color-1) 0%, var(--glow-color-2) 50%, transparent 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
}

.container {
    background: var(--card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 3rem 2.5rem;
    border-radius: 2rem;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.7), 0 0 50px rgba(14, 165, 233, 0.03);
    text-align: center;
    max-width: 420px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
    transition: border-color 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.container.success-border {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.7), 0 0 40px var(--success-glow);
}

h1 {
    font-family: 'Outfit', sans-serif;
    margin-top: 0;
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.qr-wrapper {
    margin: 1.5rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.qr-container {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(14, 165, 233, 0.1);
}

#qrcode {
    position: relative;
    width: 256px;
    height: 256px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

#qrcode img, #qrcode canvas {
    display: block;
    margin: 0 auto !important;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0.75rem;
}

.timer-text {
    font-family: monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-bright);
    margin-top: 1.5rem;
    letter-spacing: 0.1em;
    background: rgba(14, 165, 233, 0.08);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    border: 1px solid rgba(14, 165, 233, 0.15);
}

.expired-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 1.5rem;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    z-index: 5;
    animation: fadeIn 0.3s ease-out;
}

.expired-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--danger);
}

.regenerate-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(2, 132, 195, 0.4);
    transition: all 0.2s ease;
}

.regenerate-btn:hover {
    background: var(--accent-bright);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(2, 132, 195, 0.6);
}

.regenerate-btn:active {
    transform: translateY(0);
}

.start-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 1.5rem;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    z-index: 5;
    animation: fadeIn 0.3s ease-out;
}

.start-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.start-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(2, 132, 195, 0.4);
    transition: all 0.2s ease;
}

.start-btn:hover {
    background: var(--accent-bright);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(2, 132, 195, 0.6);
}

.start-btn:active {
    transform: translateY(0);
}

.status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.status.connected {
    color: var(--success);
    font-weight: 500;
}

.status.connected .spinner {
    border-top-color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(14, 165, 233, 0.2);
    border-top-color: var(--accent-bright);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.settings-panel {
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Custom Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.08);
    transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-bright);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

#result {
    display: none;
    margin-top: 1rem;
    text-align: left;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    color: var(--success);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.decrypted-box {
    background: rgba(11, 15, 25, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 1.5rem;
    min-height: 80px;
    max-height: 200px;
    overflow-y: auto;
    word-break: break-all;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

#decrypted-text {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 1.05rem;
    line-height: 1.5;
    color: #e2e8f0;
}

.result-actions {
    display: flex;
    gap: 0.75rem;
}

button.copy {
    background: var(--accent);
    border: none;
    color: white;
    padding: 0.85rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    flex: 2;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(2, 132, 195, 0.3);
}

button.copy:hover {
    background: var(--accent-bright);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(56, 189, 248, 0.4);
}

.new-session-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
    padding: 0.85rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    flex: 1;
    transition: all 0.2s ease;
}

.new-session-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { 
    from { opacity: 0; transform: translateY(15px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* Modal Overlay & Dialog Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: rgba(20, 28, 47, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2rem;
    padding: 2.5rem;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 40px 80px -10px rgba(0, 0, 0, 0.8), 0 0 40px rgba(14, 165, 233, 0.05);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content h2 {
    font-family: 'Outfit', sans-serif;
    margin-top: 0;
    font-size: 1.5rem;
    color: white;
}

.modal-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.modal-input {
    width: 100%;
    background: rgba(11, 15, 25, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    margin-bottom: 1.25rem;
    transition: all 0.3s ease;
}

.modal-input:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.modal-btn-primary {
    flex: 1.5;
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.85rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(2, 132, 195, 0.3);
}

.modal-btn-primary:hover {
    background: var(--accent-bright);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(56, 189, 248, 0.4);
}

.modal-btn-secondary {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
    padding: 0.85rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.version-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
    letter-spacing: 0.05em;
}

/* Theme Picker UI */
.theme-picker {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.theme-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 0 8px rgba(0,0,0,0.4);
}
.theme-dot:hover {
    transform: scale(1.15);
}
.theme-dot.active {
    border-color: #ffffff;
    transform: scale(1.1);
}
.dot-blue { background: #0284c7; }
.dot-green { background: #059669; }
.dot-magenta { background: #db2777; }
.dot-orange { background: #d97706; }

/* File Result Box Styles */
.file-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(11, 15, 25, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    text-align: center;
}
.file-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--accent-bright);
}
.file-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: #ffffff;
    word-break: break-all;
    margin-bottom: 0.25rem;
}
.file-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}
.file-preview {
    max-width: 100%;
    max-height: 180px;
    border-radius: 0.75rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    object-fit: contain;
}
.btn-open-link {
    background: var(--success);
    border: none;
    color: white;
    padding: 0.85rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    text-decoration: none;
    text-align: center;
    display: inline-block;
}
.btn-open-link:hover {
    background: #34d399;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(52, 211, 153, 0.4);
}
