/* CSS Variables for theme */
:root {
    --bg-color: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    --container-bg: #ffffffcc;
    --text-color: #333;
    --subtext-color: #444;
    --button-bg: #6c63ff;
    --button-hover: #5750d2;
    --input-border: #ddd;
    --color-box-text-bg: rgba(0,0,0,0.4);
}

body.dark-mode {
    --bg-color: linear-gradient(135deg, #1e1e1e, #2c2c2c);
    --container-bg: #2c2c2ccc;
    --text-color: #f0f0f0;
    --subtext-color: #ddd;
    --button-bg: #ff6c63;
    --button-hover: #d24f42;
    --input-border: #555;
    --color-box-text-bg: rgba(0,0,0,0.6);
}

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

/* Body */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
    background-color: var(--container-bg);
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-width: 700px;
    width: 100%;
    text-align: center;
    transition: background 0.3s ease;
}

/* Headings */
h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

h2 {
    font-size: 1.5rem;
    margin: 20px 0 10px 0;
    color: var(--subtext-color);
}

/* File input & button */
form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

input[type="file"] {
    padding: 10px;
    border: 2px solid var(--input-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: var(--button-bg);
}

button {
    background-color: var(--button-bg);
    color: #fff;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background-color: var(--button-hover);
}

/* Dark mode toggle button */
#darkModeToggle {
    margin-top: 10px;
    background-color: #999;
}

#darkModeToggle:hover {
    background-color: #777;
}

/* Uploaded image */
.uploaded-img {
    max-width: 100%;
    border-radius: 15px;
    margin: 15px 0;
    border: 2px solid var(--input-border);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Colors grid */
.colors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

/* Individual color box */
.color-box {
    height: 100px;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #fff;
    font-family: monospace;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    cursor: pointer;
}

.color-box span {
    background-color: var(--color-box-text-bg);
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.color-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
