/* ===========================
   Base — Common Reset & Layout
   =========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

body {
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.4s ease, color 0.4s ease;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    box-sizing: border-box;
}

/* ===========================
   Theme Selector — Fixed Toggle
   =========================== */
.theme-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid currentColor;
    background: var(--theme-toggle-bg, #ffffff);
    color: var(--theme-toggle-color, #111111);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.2s ease, background-color 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.theme-toggle-btn:hover {
    transform: scale(1.08);
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 240px;
    border-radius: 12px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    background: var(--dropdown-bg, #ffffff);
    border: 1px solid var(--dropdown-border, #e8e8e8);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.theme-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.theme-dropdown-header {
    padding: 14px 18px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--dropdown-label, #999999);
    border-bottom: 1px solid var(--dropdown-border, #e8e8e8);
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: var(--dropdown-text, #111111);
    font-family: inherit;
    font-size: 0.9rem;
}

.theme-option:hover {
    background: var(--dropdown-hover, #f5f5f5);
}

.theme-option.active {
    background: var(--dropdown-active, #f0f0f0);
    font-weight: 600;
}

.theme-option-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.theme-option-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.theme-option-name {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
}

.theme-option-desc {
    font-size: 0.7rem;
    color: var(--dropdown-label, #999999);
    line-height: 1.3;
}

/* ===========================
   Common transitions
   =========================== */
.hero,
.app-card,
.app-icon,
.since-badge,
.btn-badge,
footer {
    transition: background-color 0.4s ease, color 0.4s ease,
                border-color 0.4s ease, box-shadow 0.4s ease;
}

/* ===========================
   Mobile — Theme Selector
   =========================== */
@media (max-width: 768px) {
    .theme-selector {
        top: 12px;
        right: 12px;
    }

    .theme-toggle-btn {
        width: 38px;
        height: 38px;
    }

    .theme-dropdown {
        min-width: 220px;
    }
}