/* --- Base Theme (Bright but soft) --- */
:root {
    --bg-color: #fcfdf7;
    --header-bg: #a3d9a5; 
    --text-primary: #333333;
    --text-secondary: #666666;
    --accent-color: #ffb6c1; /* Soft pink button */
    --card-bg: #ffffff;
}

/* --- Premium Theme Example --- */
[data-theme="premium-nature"] {
    --bg-color: #e0f2f1;
    --header-bg: #4db6ac;
    --text-primary: #004d40;
    --accent-color: #ff8a65;
    --card-bg: #ffffff;
}

/* --- App Layout --- */
body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: var(--header-bg);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
}

h2 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    color: #fff;
}

main {
    padding: 1rem;
    flex-grow: 1;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* --- Forms & Inputs --- */
textarea, input {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-sizing: border-box;
    font-family: inherit;
    background-color: var(--card-bg);
    resize: vertical;
}

button {
    background-color: var(--accent-color);
    border: none;
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    width: 100%;
    font-size: 1rem;
    transition: opacity 0.2s;
}

button:active {
    opacity: 0.8;
}

.theme-switcher button {
    width: auto;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    background-color: rgba(255,255,255,0.3);
    color: var(--text-primary);
}

/* --- Modal (Popup) Background --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); 
    backdrop-filter: blur(4px); /* Softens the background behind the popup */
    align-items: center; /* Centers vertically */
    justify-content: center; /* Centers horizontally */
}

/* --- Modal Content Box --- */
.modal-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    box-sizing: border-box;
}

/* --- Close Button --- */
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--text-secondary);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--text-primary);
}

/* --- Toggle Links inside Modal --- */
.toggle-text {
    text-align: center;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.toggle-text a {
    color: var(--header-bg);
    text-decoration: none;
    font-weight: bold;
}