/* =========================================
   COMPLEX LITE - UI STYLES
   ========================================= */
:root {
    --bg-dark: #0d1b2a; 
    --card-bg: rgba(30, 41, 59, 0.85); 
    --accent-gold: #fbbf24;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --input-bg: rgba(15, 23, 42, 0.9);
    --border-color: #334155;
    --mono-font: 'Consolas', 'Monaco', 'Courier New', monospace;
}

body, html {
    margin: 0; padding: 0; height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    /* Changed from hidden to auto to allow vertical scrolling */
    overflow-x: hidden;
    overflow-y: auto;
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('blue-dark-fractal.png');
    background-size: cover; background-position: center; background-attachment: fixed;
    background-color: var(--bg-dark);
}

/* Custom Scrollbar for a more professional look */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

.main-wrapper { 
    display: flex; 
    min-height: 100vh; 
    width: 100vw; 
}

/* AD LAYOUT STYLES */
.ad-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 25px 0;
    overflow: hidden;
    min-width: 100%;
}

.ad-label {
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

.ad-top-wrapper {
    max-width: 728px;
    width: 100%;
    margin: 30px auto;
    min-height: 90px;
}

.ad-left-sidebar {
    width: 160px;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.calc-area {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 50px;
}

.calc-container {
    width: 90%;
    max-width: 800px;
    margin-top: 40px;
    padding: 2.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    backdrop-filter: blur(12px);
}

header { margin-bottom: 2.5rem; text-align: center; }
h1 { font-size: 1.8rem; color: var(--accent-gold); margin: 0; letter-spacing: 1px; }
.subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-top: 0.5rem; }
#clock-container { margin-top: 10px; font-family: var(--mono-font); color: #60a5fa; font-size: 0.9rem; text-align: center; }

.section { margin-bottom: 2rem; width: 100%; }
h2 { font-size: 1rem; color: var(--accent-gold); border-bottom: 1px solid rgba(251, 191, 36, 0.3); padding-bottom: 0.5rem; }

input[type="text"], textarea {
    width: 100%; padding: 1rem; margin: 0.75rem 0; border: 1px solid var(--border-color);
    border-radius: 0.5rem; font-family: var(--mono-font); background: var(--input-bg); color: var(--accent-gold); outline: none; box-sizing: border-box;
}

button.action-btn {
    background: var(--accent-gold); color: #000; border: none; padding: 1rem; border-radius: 0.5rem; cursor: pointer; font-weight: bold; width: 100%; transition: opacity 0.2s;
}
button.action-btn:hover { opacity: 0.9; }

.result {
    margin-top: 1rem; padding: 1.5rem; background: #f8fafc; border-radius: 0.5rem; border-left: 5px solid var(--accent-gold);
    white-space: pre-wrap; font-family: var(--mono-font); color: #1e293b; line-height: 1.6; font-size: 1.1rem;
    position: relative;
}
.result.error { border-left-color: #ef4444; color: #b91c1c; background: #fef2f2; }

.copy-btn {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #94a3b8;
    border: 1px solid #cbd5e1;
    border-radius: 0.35rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.copy-btn:hover {
    background: var(--accent-gold);
    color: #000;
    border-color: var(--accent-gold);
}
.copy-btn.copied {
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
}

/* Notepad Styles */
.switch-wrapper { position: absolute; top: 20px; right: 20px; display: flex; align-items: center; gap: 10px; font-size: 0.75rem; color: var(--text-secondary); font-weight: bold; }
.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #334155; transition: .4s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-gold); }
input:checked + .slider:before { transform: translateX(20px); }

.note-area {
    width: 0;
    background: #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
}
.note-area.active { width: 400px; }
.notepad-header { 
    background: #e2e8f0; 
    padding: 15px; 
    font-weight: bold; 
    font-size: 0.8rem; 
    color: #475569; 
    border-bottom: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
}

.notepad-dl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-left: auto;
    background: transparent;
    color: #64748b;
    border: 1px solid #cbd5e1;
    border-radius: 0.35rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.notepad-dl-btn:hover {
    background: var(--accent-gold);
    color: #000;
    border-color: var(--accent-gold);
}
.notepad-dl-btn.downloaded {
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
}

@media (max-width: 1024px) {
    .ad-left-sidebar { display: none; }
}
@media (max-width: 768px) {
    .calc-container { padding: 1.5rem; }
    .ad-top-wrapper { min-height: 100px; max-width: 100%; }
}