/* -------------------------------
   THEME VARIABLES
--------------------------------*/
:root {
    --bg: #f5f7fa;
    --text: #222;
    --card-bg: #ffffff;
    --border: #d3d7de;
    --accent: #6a8dff;
    --subtle: #666;
}

body[data-theme="dark"] {
    --bg: #121212;
    --text: #e6e6e6;
    --card-bg: #1e1e1e;
    --border: #3a3a3a;
    --accent: #8da1ff;
    --subtle: #999;
}

/* -------------------------------
   GLOBAL STYLES
--------------------------------*/
body {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", Arial, sans-serif;
    margin: 0;
    padding: 0;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 600px;
    margin: 60px auto;
    text-align: center;
}

h1 {
    font-size: 32px;
    margin-bottom: 5px;
    color: var(--text);
    transition: color 0.3s ease;
}

.subtitle {
    color: var(--subtle);
    margin-bottom: 30px;
}

/* -------------------------------
   THEME TOGGLE SWITCH
--------------------------------*/
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-label {
    color: var(--text);
    font-size: 14px;
    transition: color 0.3s ease;
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    background-color: #777;
    border-radius: 20px;
    top: 0; left: 0;
    right: 0; bottom: 0;
    transition: .3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .3s;
}

input:checked + .slider {
    background-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* -------------------------------
   FORM CARD
--------------------------------*/
.card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: left;
    transition: background 0.3s ease;
}

h2 {
    font-size: 20px;
    color: var(--text);
    margin-top: 25px;
}

label {
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
    color: var(--subtle);
    font-weight: 500;
    transition: color 0.3s ease;
}

input[type="text"],
input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 12px;
    background: var(--bg);
    color: var(--text);
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}

input[type="text"]:focus,
input[type="file"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(106,141,255,0.25);
}

button {
    margin-top: 20px;
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background: #5874e8;
}

button:active {
    transform: scale(0.98);
}

/* -------------------------------
   Background
--------------------------------*/

/* Add to the top of `style.css` (or merge into the existing :root / dark theme blocks) */
:root {
    --bg-overlay: rgba(255,255,255,0.55); /* light overlay */
}

body[data-theme="dark"] {
    --bg-overlay: rgba(0,0,0,0.55); /* dark overlay */
}

/* Replace the existing body background rules in `style.css` with this */
body {
    background-color: var(--bg); /* fallback color */
    /* gradient overlay first, then the image */
    background-image:
        linear-gradient(var(--bg-overlay), var(--bg-overlay)),
        url('/static/background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text);
    font-family: "Inter", Arial, sans-serif;
    margin: 0;
    padding: 0;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Optional: slightly dim the container to improve readability */
.container {
    max-width: 600px;
    margin: 60px auto;
    text-align: center;
    /* subtle backdrop to improve contrast */
    background: rgba(255,255,255,0.02);
    padding: 0 20px;
}

/* For dark theme, you may want a stronger container backdrop */
body[data-theme="dark"] .container {
    background: rgba(0,0,0,0.25);
    border-radius: 12px;
    padding: 20px;
}

/* -------------------------------
   IMAGE PREVIEW
--------------------------------*/
/* Image preview inside the form (centered, responsive, not too large) */
.form-image-preview {
    text-align: center;
    margin-bottom: 16px;
}

.example-img {
    display: inline-block;
    width: clamp(160px, 500px); /* minimum 160px, preferred 60% of container, max 360px */
    height: auto;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    object-fit: contain;
    max-width: 100%;
}
