/* 1. THEME VARIABLES */
:root {
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-main: #2c3e50;
    --text-sub: #7f8c8d;
    --border-color: #e0e0e0;
    --accent-color: #3498db;
    --progress-track: #e2e8f0;
}

body.dark-mode {
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --text-main: #e9ecef;
    --text-sub: #a2a8d3;
    --border-color: #2d3748;
    --accent-color: #4cc9f0;
    --progress-track: #0f3460;
}

/* 2. CORE STYLES */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background-color: var(--bg-color); 
    color: var(--text-main); 
    line-height: 1.6;
    transition: 0.3s ease;
    margin: 0;
    padding: 20px;
}

/* Fix for invisible links in Night Mode */
a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
    filter: brightness(1.2);
}

.container { 
    max-width: 700px; 
    margin: 40px auto; 
    background-color: var(--card-bg); 
    padding: 30px; 
    border-radius: 12px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

/* 3. NAVIGATION */
.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

/* 4. PROGRESS BAR */
.progress-wrapper { margin-bottom: 30px; }
.step-counter { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--text-sub); margin-bottom: 8px; }
.progress-container { height: 8px; background: var(--progress-track); border-radius: 10px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent-color), #2ecc71); transition: width 0.5s ease; }

/* 5. TOGGLE SWITCH VISUALS */
.theme-switch-wrapper { display: flex; align-items: center; }
.mode-label { margin-right: 10px; font-size: 0.8rem; font-weight: bold; color: var(--text-sub); }
.theme-switch { display: inline-block; height: 24px; position: relative; width: 50px; }
.theme-switch input { display:none; }
.slider { background-color: #ccc; bottom: 0; cursor: pointer; left: 0; position: absolute; right: 0; top: 0; transition: .4s; border-radius: 34px; }
.slider:before { background-color: #fff; bottom: 4px; content: ""; height: 16px; left: 4px; position: absolute; transition: .4s; width: 16px; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-color); }
input:checked + .slider:before { transform: translateX(26px); }

/* 6. CARDS & BUTTONS */
input[type="radio"] { display: none; }
label.option-label {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    padding: 18px;
    margin-bottom: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
}
input[type="radio"]:checked + label.option-label {
    border-color: var(--accent-color);
    background-color: rgba(52, 152, 219, 0.1);
    font-weight: bold;
}
button { background-color: var(--accent-color); color: #fff; border: none; padding: 16px; border-radius: 8px; font-weight: bold; cursor: pointer; width: 100%; }
.btn-generate { background-color: #8e44ad; font-size: 1.2rem; }

/* 7. AI STORY CARDS */
.story-card { padding: 25px; border-radius: 12px; margin-bottom: 25px; border: 1px solid var(--border-color); }
.story-card:nth-of-type(1) { background-color: rgba(241, 196, 15, 0.15); border-left: 10px solid #f1c40f; }
.story-card:nth-of-type(2) { background-color: rgba(46, 204, 113, 0.15); border-left: 10px solid #2ecc71; }
.story-card:nth-of-type(3) { background-color: rgba(231, 76, 60, 0.15); border-left: 10px solid #e74c3c; }






/* Checkbox Styling to match Radio Cards */
input[type="checkbox"] {
    display: none;
}

input[type="checkbox"]:checked + label.option-label {
    border-color: var(--accent-color);
    background-color: rgba(52, 152, 219, 0.1);
    font-weight: bold;
}


/* Make Checkbox Cards look like Radio Cards */
input[type="checkbox"] {
    display: none; /* Hide the tiny default box */
}

/* This targets the label when the hidden checkbox is checked */
input[type="checkbox"]:checked + label.option-label {
    border-color: var(--accent-color);
    background-color: rgba(52, 152, 219, 0.1);
    font-weight: bold;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
}

/* Optional: Add a checkmark icon to the card when selected */
input[type="checkbox"]:checked + label.option-label::after {
    content: " ✓";
    margin-left: 10px;
    color: var(--accent-color);
}



/* --- LOADING SPINNER STYLES --- */
#loading-area {
    display: none; /* Hidden by default */
    text-align: center;
    padding: 40px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--progress-track);
    border-top: 5px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-weight: bold;
    color: var(--text-main);
    font-size: 1.1rem;
}
















