:root {
    --primary-color: #4a6fa5;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 6px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--secondary-color);
    transition: var(--transition);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.file-upload-container {
    text-align: center;
    margin: 2rem 0;
}

.file-input {
    display: none;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.file-label:hover {
    border-color: var(--primary-color);
    background-color: rgba(74, 111, 165, 0.05);
}

.file-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.file-text {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.file-list {
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: white;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.file-item:last-child {
    border-bottom: none;
}

.file-item-info {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 1rem;
}

.file-item-name {
    font-weight: 500;
    margin-right: 0.5rem;
}

.file-item-size {
    color: var(--secondary-color);
    font-size: 0.9em;
}

.file-item-remove {
    color: var(--danger-color);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.file-item-remove:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

.file-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
}

.options {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
}

.form-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-control {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 100px;
}

.preview-container {
    margin: 2rem 0;
}

.canvas-container {
    max-width: 100%;
    overflow: auto;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.5rem;
    background: repeating-conic-gradient(#f5f5f5 0% 25%, white 0% 50%) 50% / 20px 20px;
}

canvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    background: white;
}

.actions {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    justify-content: center;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background-color: #3a5a80;
    transform: translateY(-2px);
}

.btn.secondary {
    background-color: var(--light-color);
    color: var(--dark-color);
}

.btn.secondary:hover {
    background-color: #e2e6ea;
}

.copy-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--secondary-color);
    transition: var(--transition);
}

.copy-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.textarea-container {
    position: relative;
    margin: 1rem 0;
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: monospace;
    resize: vertical;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.progress-container {
    margin: 1.5rem 0;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: var(--light-color);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.progress-text {
    display: block;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--danger-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.hidden {
    display: none !important;
}

/* Responsive styles */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .form-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-control {
        width: 100%;
    }
}
