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

body {
    font-family: Arial, sans-serif;
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
}

/* Container */
.container {
    max-width: 700px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

h1 {
    margin-bottom: 20px;
    font-size: 2em;
}

/* Canvas */
canvas {
    border: 2px solid #333;
    background: white;
    touch-action: none;
    width: 100%;
    height: 400px;
    border-radius: 8px;
    margin-top: 10px;
}

/* Tools */
.tools {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Tool Buttons */
.tool-btn {
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
    border: none;
    transition: background-color 0.3s, transform 0.2s;
}

.tool-btn:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

input[type="color"], input[type="range"], select {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

/* Settings Button */
.settings-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #007bff;
    color: white;
    font-size: 1.2em;
    padding: 10px;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.3s, transform 0.2s;
}

.settings-btn:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

/* Settings Menu */
.settings-menu {
    display: none;
    position: absolute;
    top: 50px;
    right: 20px;
    background-color: #fff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    border-radius: 8px;
    width: 200px;
    z-index: 10;
}

.settings-menu h2 {
    margin-bottom: 20px;
    font-size: 1.2em;
}

.theme-btn {
    width: 100%;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 5px;
    cursor: pointer;
    background-color: #28a745;
    color: white;
    border: none;
}

.theme-btn:hover {
    background-color: #218838;
}

/* Grid Styles */
.grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    gap: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Light Theme */
body.light {
    background-color: #f4f4f4;
    color: #333;
}

body.light .container {
    background-color: white;
}

/* Dark Theme */
body.dark {
    background-color: #2c2c2c;
    color: white;
}

body.dark .container {
    background-color: #333;
}

body.dark .tool-btn {
    background-color: #6c757d;
    color: white;
}

body.dark .tool-btn:hover {
    background-color: #5a6268;
}

/* Red Theme */
body.red {
    background-color: #f2d1d1;
    color: #900;
}

body.red .container {
    background-color: #ffcccb;
}

body.red .tool-btn {
    background-color: #ff4d4d;
    color: white;
}

body.red .tool-btn:hover {
    background-color: #ff1a1a;
}

/* Blue Theme */
body.blue {
    background-color: #e2f0f9;
    color: #0056b3;
}

body.blue .container {
    background-color: #cce0f7;
}

body.blue .tool-btn {
    background-color: #007bff;
    color: white;
}

body.blue .tool-btn:hover {
    background-color: #0056b3;
}

/* Frame Container */
.frame-container {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    margin-top: 20px;
}

.frame {
    width: 60px;
    height: 60px;
    border: 2px solid #000;
    background: #f4f4f4;
    cursor: pointer;
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* About Page */
footer {
    margin-top: 40px;
    font-size: 0.9em;
    color: #555;
}

footer a {
    color: #007bff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}