@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');

/* --- GLOBAL VARIABLES & THEME --- */
:root {
    --primary: #00d2ff;     
    --secondary: #3a7bd5;   
    --accent: #ff9f43;      
    --green: #2ecc71;       
    --red: #ff5252;         
    --bg: #1a1a2e;
    --card: #16213e;
    --input-bg: #0f3460;
    --text: #eee;
    --text-secondary: #8fbcd4;
    --border-color: #2a4d7d;
    --gold: #ffd700;
}

body.light-mode {
    --primary: #1e88e5;     
    --secondary: #0d47a1;   
    --accent: #d84315;      
    --green: #388e3c;       
    --red: #d32f2f;         
    --bg: #f5f5f5;          
    --card: #ffffff;        
    --input-bg: #e3f2fd;    
    --text: #212121;        
    --text-secondary: #546e7a;
    --border-color: #bbdefb;
}

body.theme-green { --primary: #4caf50; --secondary: #388e3c; --accent: #ffeb3b; }
body.theme-orange { --primary: #ff5722; --secondary: #e64a19; --accent: #ffc107; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    padding: 15px;
    padding-bottom: 80px;
    transition: background-color 0.3s, color 0.3s;
}

/* --- LAYOUT & ANIMATION --- */
#mainContent {
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    opacity: 1;
    transform: translateY(0);
}
.tab-content {
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    display: none; 
    position: relative;
}
.tab-content.tab-transition-start { opacity: 0; transform: translateY(15px); }
.tab-content.is-active-tab { display: block; opacity: 1; transform: translateY(0); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- COMPONENTS --- */
header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; border-bottom: 2px solid var(--secondary); padding-bottom: 15px;
}
h1 { margin: 0; font-size: 1.6rem; color: var(--primary); }
.subtitle { font-size: 0.85rem; color: var(--text-secondary); margin-top: 5px; }
h2 {
    font-size: 1.1rem; color: var(--text); border-left: 4px solid var(--secondary);
    padding-left: 10px; margin-top: 30px; margin-bottom: 15px; text-transform: uppercase;
}

/* Pro Badge */
.pro-badge {
    background-color: var(--gold); color: #000; font-size: 0.6rem;
    padding: 2px 6px; border-radius: 4px; font-weight: bold; margin-left: 5px; display: none;
}
.pro-active .pro-badge { display: inline-block; }

/* Navigation */
#tabNavigation {
    display: flex; justify-content: space-around; background-color: var(--card);
    border-radius: 10px; margin-bottom: 20px; padding: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3); border: 1px solid var(--border-color);
    flex-wrap: wrap;
}
.tab-btn {
    flex: 1; padding: 10px 5px; margin: 0 3px; background: none;
    color: var(--text-secondary); border: none; border-radius: 6px;
    font-weight: 600; font-size: 0.8rem; cursor: pointer; transition: all 0.3s;
    position: relative; min-width: 70px;
}
.tab-btn.active { background-color: var(--secondary); color: white; box-shadow: 0 2px 5px rgba(0,0,0,0.2); font-weight: bold; }
.tab-btn:hover:not(.active) { background-color: var(--card); color: var(--primary); }

.lock-icon { font-size: 0.8rem; margin-left: 2px; opacity: 0.7; }
body.is-pro-user .lock-icon { display: none !important; }
.locked-input {
    opacity: 0.5; pointer-events: none; cursor: not-allowed !important;
    background: rgba(0,0,0,0.2) !important; border-color: transparent !important;
}

/* Forms */
.card {
    background: var(--card); padding: 20px; border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4); margin-bottom: 20px;
    border: 1px solid var(--border-color); transition: background-color 0.3s;
}
label { display: block; margin-bottom: 5px; font-size: 0.85rem; color: var(--text-secondary); }
.row { display: flex; gap: 10px; }

input[type="number"], input[type="text"], input[type="email"], input[type="password"] {
    width: 100%; padding: 12px; margin-bottom: 15px;
    background: var(--input-bg); border: 1px solid var(--border-color);
    border-radius: 8px; color: var(--text); font-size: 1rem; box-sizing: border-box;
    transition: 0.3s;
}
input:focus { outline: none; border-color: var(--primary); }

button {
    width: 100%; padding: 14px; border: none; border-radius: 8px;
    color: white; font-weight: bold; font-size: 1rem; cursor: pointer;
    transition: 0.2s; margin-top: 5px;
}
button:disabled { background: gray; cursor: not-allowed; opacity: 0.5; }
button:active { transform: scale(0.98); }

.btn-blue { background: linear-gradient(45deg, var(--secondary), var(--primary)); }
.btn-orange { background: linear-gradient(45deg, var(--accent), #ff7e5f); color: var(--bg); }
.btn-green { background: linear-gradient(45deg, var(--green), #27ae60); }
.btn-gold { background: linear-gradient(45deg, #ffd700, #ffa500); color: black; }

/* Radio Group */
.radio-group {
    display: flex; background: var(--input-bg); border-radius: 8px;
    padding: 4px; margin-bottom: 15px; border: 1px solid var(--border-color);
}
.radio-option {
    flex: 1; text-align: center; padding: 8px; cursor: pointer;
    border-radius: 6px; font-size: 0.9rem; font-weight: 600;
    color: var(--text-secondary); transition: 0.3s;
}
.radio-option.active {
    background-color: var(--secondary); color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Results */
.result-box {
    background: var(--input-bg); padding: 15px; border-radius: 8px;
    margin-top: 15px; border: 1px dashed var(--primary);
    animation: fadeIn 0.4s;
}
.res-label { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; }
.res-val { font-size: 1.3rem; font-weight: bold; color: var(--primary); margin-bottom: 5px;}
.res-val-sub { font-size: 0.9rem; color: var(--text); padding: 2px 0; }
.highlight-val { color: var(--accent); font-size: 1.5rem; }

/* Modals */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); z-index: 3000; display: none; 
    align-items: center; justify-content: center;
}
.modal-content {
    background: var(--card); padding: 25px; border-radius: 12px;
    width: 90%; max-width: 400px; box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    max-height: 90vh; overflow-y: auto;
}
.color-option {
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
    border: 3px solid transparent; margin: 5px; transition: border 0.2s;
}
.color-option.selected { border-color: var(--accent); }

/* Switch Toggle */
.switch { position: relative; display: inline-block; width: 60px; height: 34px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--secondary); transition: .4s;
}
.slider:before {
    position: absolute; content: ""; height: 26px; width: 26px;
    left: 4px; bottom: 4px; background-color: white; transition: .4s;
}
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(26px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }