:root {
    --primary-color: #1a237e;
    --secondary-color: #c62828;
    --accent-color: #0d47a1;
    --success-color: #2e7d32;
    --text-dark: #212121;
    --text-light: #757575;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #1a237e 0%, #c62828 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
}

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

.tool-header {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.tool-header h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.tool-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}

.credit-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
}

.tool-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 1200px) {
    .tool-workspace {
        grid-template-columns: 1fr;
    }
}

.form-panel,
.preview-panel {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.form-panel h2,
.preview-panel h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--secondary-color);
}

.quick-select-notice {
    background: #e3f2fd;
    border-left: 4px solid var(--primary-color);
    padding: 12px 16px;
    margin-bottom: 24px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.quick-select-notice strong {
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.required {
    color: var(--secondary-color);
    margin-left: 4px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--bg-white);
    color: var(--text-dark);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

.tips-section {
    background: #f3e5f5;
    border-radius: 8px;
    padding: 20px;
    margin-top: 24px;
}

.tips-section h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.tips-section ul {
    list-style-position: inside;
    color: var(--text-dark);
}

.tips-section li {
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
}

.btn-primary:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 35, 126, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #388e3c);
    color: white;
}

.btn-success:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.3);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-secondary:not(:disabled):hover {
    background: var(--border-color);
}

.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading .btn-loader {
    display: block;
}

.btn-loader {
    display: none;
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.canvas-container {
    background: linear-gradient(45deg, #f5f5f5 25%, transparent 25%, transparent 75%, #f5f5f5 75%, #f5f5f5),
                linear-gradient(45deg, #f5f5f5 25%, transparent 25%, transparent 75%, #f5f5f5 75%, #f5f5f5);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    overflow: auto;
    max-height: 800px;
}

#previewCanvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    background: white;
    box-shadow: var(--shadow-lg);
    border-radius: 4px;
}

.preview-actions {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 12px;
}

.preview-note {
    margin-top: 16px;
    padding: 12px;
    background: #e3f2fd;
    border-radius: 6px;
    color: var(--primary-color);
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 768px) {
    .preview-actions {
        grid-template-columns: 1fr;
    }

    .tool-header h1 {
        font-size: 2rem;
    }

    .tool-container {
        padding: 20px 12px;
    }
}

.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background: var(--success-color);
}

.notification.error {
    background: var(--secondary-color);
}

.notification.info {
    background: var(--accent-color);
}
