/* Theme Base - Common styles for all themes */
/* Each theme file only needs to define :root CSS variables */

body[class*="-theme"] {
    font-family: var(--main-font);
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--background-color);
    background-image: var(--background-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body[class*="-theme"] .container {
    margin-top: 5px;
    background-color: var(--container-bg);
    padding: var(--container-padding);
    border-radius: var(--container-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 3px solid var(--border-color);
    max-width: none !important;
    width: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body[class*="-theme"] .history-container,
body[class*="-theme"] .image-container {
    margin-top: 5px;
    background-color: var(--container-bg);
    padding: 20px;
    border-radius: var(--container-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 20px;
    border: 3px solid var(--border-color);
    text-align: center;
    max-width: none !important;
    width: auto !important;
}

body[class*="-theme"] h1,
body[class*="-theme"] h2 {
    color: var(--text-color);
    text-align: center;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: var(--heading-shadow);
}

body[class*="-theme"] h1::before {
    content: var(--heading-decoration);
    margin: 0 10px;
}

body[class*="-theme"] h2::before {
    content: var(--subheading-decoration);
    margin: 0 10px;
}

body[class*="-theme"] #timer {
    font-size: 24px;
    color: var(--text-color);
    margin-bottom: 20px;
    text-align: center;
    font-weight: 700;
    text-shadow: 1px 1px 0 var(--primary-lighter);
}

body[class*="-theme"] #bestScoreDisplay {
    font-size: 20px;
    color: var(--text-color);
    margin-bottom: 20px;
    text-align: center;
    font-weight: 700;
    text-shadow: 1px 1px 0 var(--primary-lighter);
}

body[class*="-theme"] #question {
    font-size: 32px;
    margin: 20px 0;
    color: var(--text-color);
    text-align: center;
    background-color: var(--primary-lighter);
    padding: 15px;
    border-radius: 15px;
    border: 2px dashed var(--border-color);
}

body[class*="-theme"] #answer {
    font-size: 24px;
    padding: 10px;
    width: 120px;
    text-align: center;
    margin: 10px auto;
    display: block;
    border: 3px solid var(--border-color);
    border-radius: 15px;
    background-color: var(--input-bg, var(--primary-lighter));
    color: var(--text-color);
    font-family: var(--main-font);
    font-weight: 500;
}

body[class*="-theme"] #answer:focus {
    outline: none;
    box-shadow: 0 0 10px var(--focus-glow, var(--border-color));
}

body[class*="-theme"] #startButton,
body[class*="-theme"] #restartButton {
    font-size: 20px;
    padding: 12px 30px;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-family: var(--main-font);
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

body[class*="-theme"] #startButton {
    background-color: var(--primary-light);
}

body[class*="-theme"] #restartButton {
    background-color: var(--danger-color);
}

body[class*="-theme"] #startButton:hover,
body[class*="-theme"] #restartButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

body[class*="-theme"] #startButton:disabled,
body[class*="-theme"] #restartButton:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

body[class*="-theme"] .tableMode-select {
    text-align: center;
    margin: 20px 0;
}

body[class*="-theme"] .tableMode-select label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 700;
}

body[class*="-theme"] .tableMode-select select {
    padding: 10px 20px;
    font-size: 16px;
    border: 3px solid var(--border-color);
    border-radius: 15px;
    background-color: var(--input-bg, var(--primary-lighter));
    cursor: pointer;
    font-family: var(--main-font);
    color: var(--text-color);
}

body[class*="-theme"] .tableMode-select select:focus {
    outline: none;
    box-shadow: 0 0 10px var(--focus-glow, var(--border-color));
}

body[class*="-theme"] #historyList {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
}

body[class*="-theme"] #historyList li {
    padding: 10px;
    margin: 5px 0;
    background-color: var(--primary-lighter);
    border-radius: 10px;
    color: var(--text-color);
}

body[class*="-theme"] #historyList li:hover {
    background-color: var(--history-hover-bg, var(--primary-light));
    color: var(--history-hover-color, white);
}

body[class*="-theme"] .clear-history {
    padding: 10px 20px;
    background-color: var(--clear-btn-bg, var(--danger-color));
    color: white;
    border: 2px solid var(--clear-btn-border, var(--danger-dark));
    border-radius: var(--clear-btn-radius, 20px);
    cursor: pointer;
    font-family: var(--main-font);
    font-weight: 500;
    transition: all 0.3s ease;
    margin: var(--clear-btn-margin, 0);
    display: var(--clear-btn-display, inline-block);
}

body[class*="-theme"] .clear-history:hover {
    background-color: var(--clear-btn-hover-bg, var(--danger-dark));
    transform: var(--clear-btn-hover-transform, translateY(-2px));
    box-shadow: var(--clear-btn-hover-shadow, none);
}

body[class*="-theme"] .clear-history:active {
    transform: scale(0.95);
}

body[class*="-theme"] .sound-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

body[class*="-theme"] .icon-button {
    font-size: 24px;
    padding: 10px 20px;
    background-color: var(--container-bg);
    border: 3px solid var(--border-color);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--icon-btn-shadow, 0 4px 8px rgba(0, 0, 0, 0.1));
    color: var(--text-color);
}

body[class*="-theme"] .icon-button:hover {
    transform: scale(1.1);
    box-shadow: var(--icon-btn-hover-shadow, 0 6px 12px rgba(0, 0, 0, 0.15));
    background-color: var(--primary-lighter);
}

body[class*="-theme"] .icon-button:active {
    transform: scale(0.95);
}

body[class*="-theme"] .themed-element {
    position: absolute;
    bottom: -100px;
    font-size: 100px;
    animation: popUp 3s ease-in-out;
    transform-origin: bottom center;
    filter: drop-shadow(0 0 10px var(--element-glow, rgba(100, 100, 255, 0.5)));
    user-select: none;
    opacity: 0.7;
}

body[class*="-theme"] .image-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-color);
    font-weight: 500;
    background-color: var(--primary-lighter);
    border-radius: 15px;
    border: 2px dashed var(--border-color);
}

body[class*="-theme"] .image-loading::before {
    content: var(--loading-icon-before, "✨");
    margin-right: 5px;
}

body[class*="-theme"] .image-loading::after {
    content: var(--loading-icon-after, "✨");
    margin-left: 5px;
}
