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

body {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    background: #1a1a1a;
    min-height: 100vh;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.4;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.app-header {
    width: 100%;
    background: #1a1a1a;
    border-bottom: 1px solid #ffffff;
    padding: 20px 0;
    margin-bottom: 40px;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
}

h1 {
    color: #ffffff;
    font-size: 1.8em;
    font-weight: bold;
    margin: 0;
    letter-spacing: 0.5px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
    flex-shrink: 0;
}

.title-tagline {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.title-tagline h1 {
    margin: 0;
}

.tagline {
    color: #cccccc;
    font-size: 0.9em;
    margin: 0;
    font-style: italic;
}

/* CTA Button with corner decorations */
.cta-button {
    position: relative;
    display: inline-block;
    padding: 16px 32px;
    background: #90EE90;
    color: #1a1a1a;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95em;
    transition: all 0.3s ease;
    border: none;
    --grid-size: 18px;
}

.cta-button:hover {
    background: #7FDD7F;
}

.cta-button:hover .decoration {
    transform: scale(1);
}

/* Corner decorations */
.decoration {
    position: absolute;
    width: var(--grid-size);
    height: var(--grid-size);
    --grid-color: rgba(160, 186, 170, 0.4);
    border-color: var(--grid-color);
    border-style: solid;
    border-width: 0;
    transition: transform 0.3s ease;
    transform: scale(0);
}

.cta-button:hover .decoration {
    transform: scale(1);
}

.decoration.decoration-tl {
    top: calc(var(--grid-size) * -1 + 1px);
    left: calc(var(--grid-size) * -1 + 1px);
    border-bottom-width: 1px;
    border-right-width: 1px;
    transform-origin: bottom right;
}

.decoration.decoration-tr {
    top: calc(var(--grid-size) * -1 + 1px);
    right: calc(var(--grid-size) * -1 + 1px);
    border-bottom-width: 1px;
    border-left-width: 1px;
    transform-origin: bottom left;
}

.decoration.decoration-bl {
    bottom: calc(var(--grid-size) * -1 + 1px);
    left: calc(var(--grid-size) * -1 + 1px);
    border-top-width: 1px;
    border-right-width: 1px;
    transform-origin: top right;
}

.decoration.decoration-br {
    bottom: calc(var(--grid-size) * -1 + 1px);
    right: calc(var(--grid-size) * -1 + 1px);
    border-top-width: 1px;
    border-left-width: 1px;
    transform-origin: top left;
}

.upload-section {
    margin-bottom: 30px;
}

.upload-label {
    display: block;
    width: 100%;
    padding: 40px 20px;
    border: 2px dashed #ffffff;
    border-radius: 0;
    text-align: center;
    cursor: pointer;
    background: none;
    transition: all 0.3s ease;
}

.upload-label:hover {
    background: #2a2a2a;
    border-color: #cccccc;
}

.upload-label.dragover {
    background: #2a2a2a;
    border-color: #cccccc;
    transform: scale(1.02);
}

.upload-text {
    color: #ffffff;
    font-size: 1em;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
}

.controls-section {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.canvas-size-controls {
    grid-column: span 3;
}

.background-controls {
    grid-column: span 3;
}

.effect-controls,
.text-controls,
.action-controls {
    grid-column: span 2;
}

.canvas-size-controls,
.background-controls,
.effect-controls,
.text-controls,
.action-controls {
    background: none;
    border: 1px solid #ffffff;
    padding: 15px;
    border-radius: 0;
    margin-bottom: 10px;
}

.canvas-size-controls h3,
.background-controls h3,
.effect-controls h3,
.text-controls h3 {
    margin-bottom: 10px;
    color: #ffffff;
    text-transform: none;
    letter-spacing: normal;
    font-size: 1em;
    font-weight: normal;
    border-bottom: 1px solid #333333;
    padding-bottom: 5px;
}

.control-group {
    margin-bottom: 10px;
}

.control-group label {
    display: block;
    margin-bottom: 3px;
    font-weight: normal;
    color: #ffffff;
    text-transform: none;
    font-size: 0.9em;
    letter-spacing: normal;
}

.control-group input[type="range"] {
    width: 100%;
    height: 20px;
    border-radius: 0;
    background: #1a1a1a;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid #ffffff;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 18px;
    border-radius: 0;
    background: #ffffff;
    cursor: pointer;
    border: none;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 18px;
    border-radius: 0;
    background: #ffffff;
    cursor: pointer;
    border: none;
}

.control-group input[type="text"],
.control-group textarea,
.control-group input[type="number"],
.control-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ffffff;
    border-radius: 0;
    font-size: 14px;
    background: #1a1a1a;
    color: #ffffff;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="white" d="M6 9L1 4h10z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 30px;
}

.control-group select:focus {
    outline: none;
    border-color: #ffffff;
    background-color: #2a2a2a;
}

.control-group select option {
    background: #1a1a1a;
    color: #ffffff;
    padding: 8px;
}

.control-group input[type="text"]:focus,
.control-group textarea:focus,
.control-group input[type="number"]:focus,
.control-group select:focus {
    outline: none;
    border-color: #ffffff;
    background: #2a2a2a;
}

.control-group input[type="color"] {
    width: 60px;
    height: 30px;
    border: 1px solid #ffffff;
    border-radius: 0;
    cursor: pointer;
    background: #1a1a1a;
}

.control-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin-right: 8px;
    vertical-align: middle;
    accent-color: #ffffff;
}

.control-group label input[type="checkbox"] {
    margin-bottom: 0;
}

#customSizeInputs {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

#customSizeInputs input {
    flex: 1;
}

.action-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.action-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-direction: column;
}

button {
    padding: 8px 16px;
    border: 1px solid #ffffff;
    border-radius: 0;
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
    background: #1a1a1a;
    color: #ffffff;
    text-transform: none;
    letter-spacing: normal;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

#resetBtn {
    background: #1a1a1a;
    color: #ffffff;
    border-color: #ffffff;
}

#resetBtn:hover {
    background: #2a2a2a;
}

#downloadBtn {
    background: #1a1a1a;
    color: #ffffff;
    border-color: #ffffff;
}

#downloadBtn:hover {
    background: #2a2a2a;
}

.canvas-section {
    text-align: center;
    background: none;
    border: 1px solid #ffffff;
    padding: 20px;
    border-radius: 0;
}

#canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #ffffff;
    border-radius: 0;
    touch-action: none; /* Better touch handling for mobile */
    user-select: none; /* Prevent text selection while dragging */
}

.value-display {
    font-weight: normal;
    color: #ffffff;
    margin-left: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .controls-section {
        grid-template-columns: 1fr;
    }

    .action-controls {
        flex-direction: column;
    }

    .container {
        padding: 10px;
    }

    .header-content {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
    }

    .cta-button {
        width: 100%;
        text-align: center;
        font-size: 0.85em;
        padding: 14px 24px;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
    border: 1px solid #ffffff;
}

::-webkit-scrollbar-thumb {
    background: #ffffff;
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: #cccccc;
}

/* Footer */
.footer {
    width: 100%;
    background: #1a1a1a;
    border-top: 1px solid #ffffff;
    padding: 20px 0;
    margin-top: 40px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer p {
    margin: 0;
    color: #cccccc;
    font-size: 0.9em;
}

.footer a {
    color: #ffffff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.footer a:hover {
    border-bottom-color: #ffffff;
}
