body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #1a1a1a;
    color: #ffffff;
    font-family: 'Segoe UI', Arial, sans-serif;
    overflow: auto;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

#toolbar {
    width: 100%;
    background: linear-gradient(90deg, #ff6b6b, #368c87, #45b7d1, #96c93d);
    padding: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: row;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

#toolbar.hidden {
    transform: translateY(-100%);
}

#tab-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

#tab-bar::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    border-radius: 15px;
    transition: all 0.3s ease;
    width: 80px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab img {
    width: 70px;
    height: 40px;
    border-radius: 10px;
}

.tab:hover, .tab:focus {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
    outline: 2px solid #3498db;
}

.tab.active {
    background: rgba(0, 0, 0, 0.9);
}

.tab-content {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    padding: 12px;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}


.tab-content.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dropdown-container select, .dropdown-container input {
    width: 100%;
    max-width: 200px;
    height: 32px;
    font-size: 14px;
    background: #34495e;
    border: 1px solid #555;
    border-radius: 4px;
    color: #fff;
    padding: 4px;
}

.dropdown-container select:focus, .dropdown-container input:focus {
    outline: 2px solid #3498db;
}

.dropdown-container label {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
}

#randomizeAllColors, #removeColorImage {
    width: 120px;
    height: 32px;
    font-size: 12px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#actions-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 8px;
    background: linear-gradient(90deg, #4f0e0e, #251a84, #115f70, #4a6e0a);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    scrollbar-width: none;
}

#actions-row::-webkit-scrollbar {
    display: none;
}
#rbg {
    display: flex;
    gap: 8px;
    align-items: left;
    width: 200px;
}
#actions-row button {
    min-width: 50px;
    height: 40px;
    padding: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#actions-row button img {
    width: 44px;
    height: 24px;
}

#canvas-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    background: linear-gradient(to top, rgba(26, 26, 26, 0.8), transparent);
    position: relative;
    overflow: hidden;
}

#canvas {
    width: 100%;
    height: 100%;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
    touch-action: none;
}

button {
    background: linear-gradient(45deg, #534b34, #382531);
    border: 1px solid #555d55;
    padding: 8px;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

button:hover, button:focus {
    background: linear-gradient(45deg, #34495e, #2c3e50);
    transform: scale(1.05);
    outline: 2px solid #3498db;
}

input[type="range"], input[type="color"], input[type="number"], input[type="file"], select {
    height: 32px;
    font-size: 12px;
    accent-color: #3498db;
}

select {
    background: #34495e;
    border: 1px solid #555;
    padding: 4px;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
}

select:hover {
    background: #46637f;
}

h4 {
    margin: 0;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

label {
    margin: 0;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    z-index: 9999;
}

.slider-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.slider-value {
    font-size: 10px;
    color: #3498db;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 4px;
    border-radius: 2px;
}

#transparentBg, #performanceMode, #gradientBg {
    transform: scale(1.5);
    margin-left: 8px;
}

@media screen and (max-width: 768px) {
    #toolbar {
        padding: 6px;
        flex-direction: column;
    }
    #tab-bar {
        gap: 6px;
        width: 100%;
        justify-content: space-around;
    }
    .tab {
        width: 56px;
        height: 36px;
    }
    .tab img {
        width: 45px;
        height: 30px;
    }
    #actions-row {
        gap: 6px;
        padding: 6px;
        width: 100%;
        justify-content: space-around;
    }
    .tab-content {
        top: 50px;
    }
    #actions-row button {
        min-width: 56px;
        height: 36px;
    }
    #actions-row button img {
        width: 35px;
        height: 20px;
    }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.notification.show {
    opacity: 1;
}

.notification.error {
    background: rgba(255, 75, 75, 0.9);
}

.notification.success {
    background: rgba(39, 54, 103, 0.9);
}

#welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    z-index: 20;
    transition: opacity 0.5s ease;
}

.welcome-content {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-align: center;
    max-width: 600px;
    width: 90%;
}

.welcome-content h1 {
    font-size: 36px;
    margin: 0 0 15px;
    color: #fff;
}

.welcome-text {
    font-size: 18px;
    color: #ddd;
    margin: 0 0 20px;
}

.quote {
    font-size: 16px;
    font-style: italic;
    color: #f0f0f0;
    margin: 0 0 25px;
}

#close-welcome {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 25px;
    transition: transform 0.3s ease, background 0.3s ease;
}

#close-welcome:hover {
    background: linear-gradient(45deg, #4ecdc4, #ff6b6b);
    transform: scale(1.1);
}

#welcome-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

#orientation-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

#orientation-overlay button {
    margin-top: 10px;
    padding: 5px 10px;
}

@media screen and (max-width: 768px) and (orientation: portrait) {
    #orientation-overlay {
        display: flex;
    }
}
{
    #colorInputs .dropdown-container label {
        font-size: 12px;
    }
    #colorInputs input[type="color"] {
        border: 1px solid #ccc;
        padding: 0;
    }
}
.fullscreen #canvas-container {
    width: 100vw;
    height: 100vh;
    padding: 0;
    overflow: hidden;
}

.fullscreen #canvas {
    width: 100%;
    height: 100%;
}

.fullscreen #toolbar {
    position: relative;
    z-index: 15;
    width: 100%;
    transform: translateY(-100%);
}

.fullscreen #actions-row {
    transform: translateY(-100%);
}

#showToolbarBtn {
    display: none;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 20;
    background: linear-gradient(45deg, #4ecdc4, #ff6b6b);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    color: white;
}

.fullscreen #showToolbarBtn {
    display: block;
}

[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 10px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
}

[data-tooltip]:hover::after, [data-tooltip]:focus::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

.color-picker-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-picker-container button {
    padding: 4px 8px;
    font-size: 10px;
    min-width: 60px;
}

footer {
    text-align: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.8);
    font-size: 12px;
    color: #e0e0e0;
}

footer a {
    color: #3498db;
    text-decoration: none;
    margin: 0 5px;
}

footer a:hover {
    text-decoration: underline;
}