/* ==========================================================================
   Octi - The Official Website — Shared Styles
   Used by: index, books, book1, about, contact, coming-soon, feedback, ideas,
            contributors
   Not used by: 404.html (has its own inline styles)
   ========================================================================== */

/* ---------- 1. Theme Variables ---------- */
:root, [data-theme="dark"] {
    --bg: linear-gradient(180deg, #0a1a3a 0%, #0d2247 50%, #132d5c 100%);
    --nav-bg: rgba(10, 26, 58, 0.95);
    --card-bg: rgba(13, 34, 71, 0.8);
    --friend-bg: rgba(255, 255, 255, 0.08);
    --accent: #00bfff;
    --accent-dark: #0099cc;
    --text: #e6f2ff;
    --text-secondary: #b3d9ff;
    --border: rgba(255, 255, 255, 0.15);
    --shadow: rgba(0, 0, 0, 0.4);
    --shadow-glow: rgba(0, 191, 255, 0.4);
}
[data-theme="light"] {
    --bg: linear-gradient(180deg, #ffffff 0%, #f0f8ff 50%, #e6f7ff 100%);
    --nav-bg: rgba(255, 255, 255, 0.95);
    --card-bg: #ffffff;
    --friend-bg: rgba(0, 0, 0, 0.04);
    --accent: #0077be;
    --accent-dark: #005a8e;
    --text: #0a1a3a;
    --text-secondary: #005a8e;
    --border: rgba(0, 0, 0, 0.1);
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-glow: rgba(0, 119, 190, 0.3);
}
[data-color="blue"]   { --accent: #00bfff; --accent-dark: #0099cc; }
[data-color="red"]    { --accent: #ff4444; --accent-dark: #cc0000; }
[data-color="green"]  { --accent: #44cc44; --accent-dark: #228822; }
[data-color="yellow"] { --accent: #ffcc00; --accent-dark: #cc9900; }
[data-color="purple"] { --accent: #aa66ff; --accent-dark: #7733cc; }
[data-color="pink"]   { --accent: #ff66aa; --accent-dark: #cc3377; }
[data-theme="light"][data-color="blue"]   { --accent: #0077be; --accent-dark: #005a8e; }
[data-theme="light"][data-color="red"]    { --accent: #cc0000; --accent-dark: #990000; }
[data-theme="light"][data-color="green"]  { --accent: #228822; --accent-dark: #115511; }
[data-theme="light"][data-color="yellow"] { --accent: #cc9900; --accent-dark: #996600; }
[data-theme="light"][data-color="purple"] { --accent: #7733cc; --accent-dark: #551199; }
[data-theme="light"][data-color="pink"]   { --accent: #cc3377; --accent-dark: #991155; }

/* ---------- 2. Reset & Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

/* ---------- 3. Navigation ---------- */
nav {
    background: var(--nav-bg);
    padding: 15px 20px;
    box-shadow: 0 4px 20px var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--accent);
    transition: all 0.3s;
}
nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
nav ul li a {
    color: var(--accent);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s;
    display: inline-block;
}
nav ul li a:hover,
nav ul li a.active {
    background: var(--friend-bg);
    color: var(--text);
    transform: scale(1.05);
}
.icon-btn {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
    font-size: 1.2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.icon-btn:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.1) rotate(15deg);
}

/* ---------- 4. Page Title ---------- */
.page-title { text-align: center; padding: 50px 20px 20px; }
.page-title h1 {
    font-size: 3rem;
    color: var(--accent);
    text-shadow: 0 0 20px var(--shadow-glow);
    transition: color 0.3s;
}
.page-title p { color: var(--text-secondary); }

/* ---------- 5. Section Card ---------- */
.section {
    max-width: 800px;
    margin: 30px auto;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 8px 25px var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s;
}
.section h2 {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-align: center;
    transition: color 0.3s;
}
.section p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}
.section ul { margin: 15px 0 15px 25px; }
.section ul li { margin-bottom: 8px; color: var(--text-secondary); }

/* ---------- 6. Buttons ---------- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s;
    margin: 5px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
}
.btn-buy { background: #ff9900; color: white; box-shadow: 0 5px 15px rgba(255, 153, 0, 0.35); }
.btn-buy:hover { background: #e68a00; transform: scale(1.05); }
.btn-info { background: var(--accent); color: white; }
.btn-info:hover { opacity: 0.85; transform: scale(1.05); }
.btn-secondary { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn-secondary:hover { background: var(--accent); color: white; transform: scale(1.05); }
.btn-disabled { background: #666; color: #ccc; cursor: not-allowed; }

/* Format buttons (Book 1 page buy row) */
.btn-format {
    padding: 12px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    font-size: 1rem;
    display: inline-block;
    text-align: center;
}
.btn-paperback { background: #ff9900; color: white; }
.btn-hardcover { background: #4CAF50; color: white; }
.btn-kindle    { background: var(--accent); color: white; }
.btn-format:hover { transform: scale(1.08); opacity: 0.9; }

/* Format modal buttons (Home page "Choose Your Format") */
.format-options { display: flex; flex-direction: column; gap: 15px; }
.format-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    border-radius: 15px;
    text-decoration: none;
    transition: all 0.3s;
    border: 2px solid transparent;
}
.format-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 25px var(--shadow); }
.format-btn .format-icon { font-size: 2rem; margin-bottom: 5px; }
.format-btn .format-name { font-size: 1.2rem; font-weight: bold; margin-bottom: 5px; }
.format-btn .format-desc { font-size: 0.9rem; opacity: 0.9; }
.format-paperback { background: rgba(255, 153, 0, 0.15); border-color: #ff9900; color: #cc7a00; }
[data-theme="light"] .format-paperback { color: #b36b00; }
.format-paperback:hover { background: rgba(255, 153, 0, 0.3); }
.format-hardcover { background: rgba(76, 175, 80, 0.15); border-color: #4CAF50; color: #2e7d32; }
.format-hardcover:hover { background: rgba(76, 175, 80, 0.3); }
.format-kindle { background: rgba(0, 191, 255, 0.15); border-color: var(--accent); color: var(--accent); }
.format-kindle:hover { background: rgba(0, 191, 255, 0.3); }

/* ---------- 7. Friends Grid ---------- */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.friend-card {
    background: var(--friend-bg);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid var(--border);
}
.friend-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px var(--border); }
.friend-card .emoji { font-size: 3rem; }
.friend-card h3 { color: var(--accent); margin: 10px 0; transition: color 0.3s; }
.friend-card p { color: var(--text-secondary); }

/* ---------- 8. Footer ---------- */
footer {
    background: var(--nav-bg);
    color: var(--text-secondary);
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    border-top: 2px solid var(--accent);
    transition: all 0.3s;
}
footer a { color: #ff9900; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ---------- 9. Modals ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--card-bg);
    border-radius: 25px;
    padding: 40px 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px var(--shadow-glow);
    border: 2px solid var(--accent);
    position: relative;
    animation: modalIn 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
    position: absolute;
    top: 15px; right: 20px;
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
}
.modal-close:hover { color: #ff9900; transform: scale(1.2); }
.modal h2 { color: var(--accent); text-align: center; margin-bottom: 10px; font-size: 1.8rem; }
.modal .modal-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 25px; font-size: 1rem; }

/* ---------- 10. Settings Modal Components ---------- */
.settings-section { margin-bottom: 25px; }
.settings-section h3 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}
.color-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.color-option {
    padding: 12px;
    border-radius: 12px;
    border: 3px solid transparent;
    cursor: pointer;
    text-align: center;
    font-weight: bold;
    color: white;
    transition: all 0.3s;
    font-size: 0.9rem;
}
.color-option:hover { transform: scale(1.05); }
.color-option.active { border-color: var(--text); box-shadow: 0 0 15px var(--accent); }
.color-blue   { background: #00bfff; color: #0a1a3a; }
.color-red    { background: #ff4444; }
.color-green  { background: #44cc44; color: #0a1a3a; }
.color-yellow { background: #ffcc00; color: #0a1a3a; }
.color-purple { background: #aa66ff; }
.color-pink   { background: #ff66aa; }
.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    gap: 10px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row span { color: var(--text-secondary); }
.small-btn {
    padding: 8px 18px;
    border-radius: 25px;
    border: 2px solid var(--accent);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    font-family: inherit;
    font-size: 0.9rem;
    white-space: nowrap;
}
.small-btn:hover { background: var(--accent); color: white; }

/* ---------- 11. Cookie Banner ---------- */
.cookie-banner {
    display: none;
    position: fixed;
    bottom: 0; left: 0;
    width: 100%;
    background: var(--card-bg);
    border-top: 3px solid var(--accent);
    padding: 20px;
    z-index: 3000;
    box-shadow: 0 -5px 25px var(--shadow);
}
.cookie-banner.active { display: block; }
.cookie-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    text-align: center;
}
.cookie-content p { color: var(--text-secondary); font-size: 0.95rem; }
.cookie-buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- 12. Forms (Feedback & Ideas) ---------- */
.form-group { margin-bottom: 18px; }
label {
    color: var(--text);
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
}
input[type="text"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: var(--friend-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
}
input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--shadow-glow);
}
input[type="text"]::placeholder,
input[type="email"]::placeholder,
textarea::placeholder { color: var(--text-secondary); opacity: 0.7; }
textarea { resize: vertical; min-height: 120px; }
.radio-group,
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-option,
.checkbox-option {
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid var(--border);
    background: var(--friend-bg);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    color: var(--text-secondary);
}
.radio-option:hover,
.checkbox-option:hover { border-color: var(--accent); }
.radio-option.selected,
.checkbox-option.selected {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.form-note { font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; }
.form-submit { width: 100%; margin-top: 10px; }
.form-success {
    display: none;
    background: rgba(76, 175, 80, 0.15);
    border: 2px solid #4CAF50;
    color: #4CAF50;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
    font-weight: bold;
}
.form-success.active { display: block; }
.form-error {
    display: none;
    background: rgba(255, 68, 68, 0.15);
    border: 2px solid #ff4444;
    color: #ff4444;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    margin-top: 15px;
    font-weight: bold;
}
.form-error.active { display: block; }

/* ---------- 13. Mobile Breakpoints ---------- */
@media (min-width: 768px) {
    .cookie-content { flex-direction: row; justify-content: space-between; text-align: left; }
}
@media (max-width: 480px) {
    nav ul li a { padding: 8px 14px; font-size: 0.9rem; }
    .icon-btn { width: 40px; height: 40px; font-size: 1rem; }
    .page-title h1 { font-size: 2rem; }
    .section { padding: 20px; margin: 20px 15px; }
    .section h2 { font-size: 1.5rem; }
    .modal { padding: 30px 20px; }
    .color-grid { grid-template-columns: repeat(2, 1fr); }
    .btn,
    .btn-format { width: 100%; margin: 6px 0; }
    .friends-grid { grid-template-columns: 1fr; }
}