:root {
    --sig-gen-theme-color: #52C48C;
}

* {
    box-sizing: border-box;
}

.sig-gen-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #F5F5F5;
}

.sig-gen-title {
    font-size: 32px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
    margin: 0 0 40px 0;
}

.sig-gen-canvas-wrapper {
    background: #FFFFFF;
    border: 2px solid #E5E5E5;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 30px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sig-gen-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    cursor: crosshair;
    touch-action: none;
}

.sig-gen-type-preview {
    width: 100%;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 48px;
    text-align: center;
    padding: 40px;
    word-wrap: break-word;
    background: transparent;
    color: #000000;
    font-family: 'Great Vibes', cursive;
    background-image:
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.sig-gen-text-input-wrapper {
    margin-bottom: 20px;
}

.sig-gen-text-input,
.sig-gen-text-input-type {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    border: 2px solid var(--sig-gen-theme-color);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease;
}

.sig-gen-text-input:focus,
.sig-gen-text-input-type:focus {
    border-color: var(--sig-gen-theme-color);
    filter: brightness(0.85);
}

.sig-gen-draw-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.sig-gen-color-control,
.sig-gen-width-control,
.sig-gen-font-control,
.sig-gen-font-size-control,
.sig-gen-background-control,
.sig-gen-rotate-control,
.sig-gen-slant-control {
    background: #FFFFFF;
    border: 2px solid #E5E5E5;
    border-radius: 12px;
    padding: 16px 20px;
    flex: 1;
    min-width: 200px;
}

.sig-gen-color-control label,
.sig-gen-width-control label,
.sig-gen-font-control label,
.sig-gen-font-size-control label,
.sig-gen-background-control label,
.sig-gen-rotate-control label,
.sig-gen-slant-control label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
}

.sig-gen-color-display {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.sig-gen-color-circle,
.sig-gen-type-color-circle,
.sig-gen-bg-color-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #000000;
    border: 2px solid #E5E5E5;
}

.sig-gen-type-color-circle {
    background-color: #000000;
}

.sig-gen-bg-color-circle {
    background-color: #FFFFFF;
}

.sig-gen-bg-options {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}

.sig-gen-bg-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
}

.sig-gen-bg-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--sig-gen-theme-color);
}

.sig-gen-color-hex,
.sig-gen-type-color-hex,
.sig-gen-bg-color-hex {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.sig-gen-color-picker,
.sig-gen-type-color-picker,
.sig-gen-bg-color-picker {
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.sig-gen-thickness,
.sig-gen-rotate-slider,
.sig-gen-slant-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #E5E5E5;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.sig-gen-thickness::-webkit-slider-thumb,
.sig-gen-rotate-slider::-webkit-slider-thumb,
.sig-gen-slant-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--sig-gen-theme-color);
    cursor: pointer;
    border: 3px solid #FFFFFF;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.sig-gen-thickness::-moz-range-thumb,
.sig-gen-rotate-slider::-moz-range-thumb,
.sig-gen-slant-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--sig-gen-theme-color);
    cursor: pointer;
    border: 3px solid #FFFFFF;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.sig-gen-type-controls {
    margin-bottom: 30px;
}

.sig-gen-control-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sig-gen-control-row:last-child {
    margin-bottom: 0;
}

.sig-gen-font-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #E5E5E5;
    border-radius: 8px;
    background: #FFFFFF;
    cursor: pointer;
    outline: none;
}

.sig-gen-font-size-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
}

.sig-gen-font-size-decrease,
.sig-gen-font-size-increase {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a1a1a;
    color: #FFFFFF;
    border: none;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.sig-gen-font-size-decrease:hover,
.sig-gen-font-size-increase:hover {
    background: #333;
}

.sig-gen-font-size-value {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    min-width: 40px;
    text-align: center;
}

.sig-gen-range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 14px;
    color: #999;
}

.sig-gen-range-labels span:nth-child(2) {
    background: var(--sig-gen-theme-color);
    color: #FFFFFF;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
}

.sig-gen-footer {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.sig-gen-btn-cancel,
.sig-gen-btn-save {
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 600;
    border: 2px solid var(--sig-gen-theme-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    min-width: 160px;
}

.sig-gen-btn-cancel {
    background: #FFFFFF;
    color: var(--sig-gen-theme-color);
}

.sig-gen-btn-cancel:hover {
    background: #f0fdf7;
}

.sig-gen-btn-save {
    background: var(--sig-gen-theme-color);
    color: #FFFFFF;
    border-color: var(--sig-gen-theme-color);
}

.sig-gen-btn-save:hover {
    filter: brightness(0.85);
}

.sig-gen-message {
    margin-top: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
}

.sig-gen-message-success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.sig-gen-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

@media (max-width: 768px) {
    .sig-gen-container {
        padding: 20px 15px;
    }

    .sig-gen-title {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .sig-gen-canvas-wrapper {
        min-height: 200px;
    }

    .sig-gen-type-preview {
        min-height: 200px;
        font-size: 32px;
        padding: 20px;
    }

    .sig-gen-draw-controls,
    .sig-gen-control-row {
        flex-direction: column;
    }

    .sig-gen-color-control,
    .sig-gen-width-control,
    .sig-gen-font-control,
    .sig-gen-font-size-control,
    .sig-gen-background-control,
    .sig-gen-rotate-control,
    .sig-gen-slant-control {
        min-width: 100%;
    }

    .sig-gen-footer {
        flex-direction: column;
    }

    .sig-gen-btn-cancel,
    .sig-gen-btn-save {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .sig-gen-title {
        font-size: 20px;
    }

    .sig-gen-canvas-wrapper {
        min-height: 150px;
    }

    .sig-gen-type-preview {
        min-height: 150px;
        font-size: 24px;
    }

    .sig-gen-btn-cancel,
    .sig-gen-btn-save {
        padding: 14px 24px;
        font-size: 16px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .sig-gen-canvas {
        cursor: default;
    }
}

.sig-gen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: sig-gen-modal-fadein 0.3s ease;
}

.sig-gen-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.sig-gen-modal-content {
    position: relative;
    background: #FFFFFF;
    border-radius: 24px;
    padding: 60px 40px 40px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: sig-gen-modal-slideup 0.3s ease;
}

.sig-gen-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: #F5F5F5;
    border-radius: 50%;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.sig-gen-modal-close:hover {
    background: #E5E5E5;
    color: #333;
    transform: rotate(90deg);
}

.sig-gen-modal-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: sig-gen-modal-bounce 0.6s ease;
}

.sig-gen-modal-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px 0;
}

.sig-gen-modal-message {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
    margin: 0 0 30px 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.sig-gen-modal-button {
    background: var(--sig-gen-theme-color);
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.sig-gen-modal-button:hover {
    filter: brightness(0.85);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

@keyframes sig-gen-modal-fadein {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes sig-gen-modal-slideup {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes sig-gen-modal-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@media (max-width: 768px) {
    .sig-gen-modal-content {
        padding: 40px 30px 30px;
        border-radius: 20px;
    }

    .sig-gen-modal-icon {
        font-size: 60px;
    }

    .sig-gen-modal-title {
        font-size: 24px;
    }

    .sig-gen-modal-message {
        font-size: 15px;
    }

    .sig-gen-modal-button {
        width: 100%;
        padding: 14px 24px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .sig-gen-modal-content {
        padding: 30px 20px 20px;
        width: 95%;
    }

    .sig-gen-modal-close {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .sig-gen-modal-icon {
        font-size: 50px;
    }

    .sig-gen-modal-title {
        font-size: 20px;
    }

    .sig-gen-modal-message {
        font-size: 14px;
    }
}
