/* ================== RESET / BASE ================== */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Inter", Arial, sans-serif;
    background: #f7f7f8;
    color: #222;
    transition: background .3s, color .3s;
}

body.dark {
    background: #101014;
    color: #e5e5e5;
}

/* ================== HEADER ================== */

.app-header {
    background: #ffffffcc;
    backdrop-filter: blur(10px);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 10;
}

body.dark .app-header {
    background: #18181dcc;
    border-bottom-color: #333;
}

.logo {
    font-size: 26px;
    font-weight: 700;
}

.dot-circle {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #8b4eff;
    border-radius: 50%;
    margin: 0 3px;
    vertical-align: baseline;
}

body.dark .dot-circle {
    background: #b388ff;
}

.header-actions {
    display: flex;
    gap: 14px;
    align-items: center;
}

/* ================== THEME TOGGLE (UPDATED) ================== */

.theme-toggle {
    background: #ddd;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
}

body.dark .theme-toggle {
    background: #333;
}

/* icons inside toggle */
.theme-icon {
    font-size: 20px;
    line-height: 1;
    display: none; /* default hidden */
}

/* Show icon depending on theme */
body.light .theme-icon.sun {
    display: inline;
}

body.light .theme-icon.moon {
    display: none;
}

body.dark .theme-icon.sun {
    display: none;
}

body.dark .theme-icon.moon {
    display: inline;
}

/* ================== END THEME TOGGLE ================== */

.pro-link {
    color: #8b4eff;
    font-weight: 600;
    text-decoration: none;
}

/* ================== FLOATING PRO BADGE ================== */

.pro-floating {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: #8b4eff;
    color: white;
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    z-index: 20;
    animation: floatIn .4s ease;
}

.pro-floating a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

@keyframes floatIn {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ================== LAYOUT ================== */

.layout {
    display: flex;
    gap: 24px;
    padding: 24px;
}

.sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ================== CARDS ================== */

.card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

body.dark .card {
    background: #1a1a1f;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.card h2 {
    margin-top: 0;
    font-size: 18px;
    margin-bottom: 14px;
}

/* ================== INPUTS & SELECTS ================== */

input, select, textarea {
    width: 100%;
    padding: 10px;
    margin-top: 4px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 14px;
}

body.dark input,
body.dark select,
body.dark textarea {
    background: #2a2a2f;
    color: #eee;
    border-color: #444;
}

/* Icon labels */
.icon-label {
    position: relative;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.icon-label .icon {
    opacity: 0.6;
    font-size: 14px;
}

/* Disabled Pro pattern text */
select optgroup[label^="Pro"] option {
    color: #aaa;
}

/* ================== BUTTONS ================== */

.btn {
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 4px;
}

.primary-btn {
    background: #8b4eff;
    color: #fff;
}

.primary-btn:hover {
    background: #6f37e8;
}

.generate-top {
    margin-bottom: 22px;
}

/* ================== UPGRADE CARD ================== */

.upgrade-banner {
    border-left: 5px solid #8b4eff;
}

.upgrade-banner h3 {
    margin-top: 0;
}

.upgrade-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    background: #8b4eff;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

/* ================== COLLAPSIBLE SECTIONS ================== */

.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.collapse-section {
    margin-bottom: 0px;
}

.collapse-header {
    width: 100%;
    background: #ececf3;
    padding: 10px;
    border: none;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: .2s;
}

.collapse-header.open {
    background: #dcd9ff;
}

body.dark .collapse-header {
    background: #fff;
}

body.dark .collapse-header.open {
    background: #fff;
}

.collapse-content {
    display: none;
    padding-top: 12px;
}

/* ================== PREVIEW BOX ================== */

.preview-box {
    background: #e3e3e6;
    min-height: 480px;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

body.dark .preview-box {
    background: #2a2a33;
}

/* ================== RESPONSIVE ================== */

@media (max-width: 900px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .pro-floating {
        bottom: 18px;
        right: 18px;
    }
}
