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

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

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

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #2c3e50;
    font-size: 2rem;
}

/* Input Section */
.input-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

#svgInput {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s;
}

#svgInput:focus {
    outline: none;
    border-color: #3498db;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: #fff;
    margin-top: 15px;
}

.btn-primary:hover {
    background-color: #2980b9;
}

/* Icons Section */
.icons-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.icons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.icon-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.icon-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Background Switcher */
.bg-switcher {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.bg-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: border-color 0.2s;
}

.bg-btn:hover {
    border-color: #bbb;
}

.bg-btn.active {
    border-color: #f27c00;
    border-width: 2px;
}

.bg-btn-light {
    background: #f0f0f0;
}

.bg-btn-white {
    background: #ffffff;
}

.bg-btn-dark {
    background: #2c2c2c;
}

.bg-btn-checkered {
    background-image:
        linear-gradient(45deg, #ccc 25%, transparent 25%),
        linear-gradient(-45deg, #ccc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ccc 75%),
        linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
    background-color: #fff;
}

.icon-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: background 0.2s;
}

/* Preview Background Options */
.icon-preview.bg-light {
    background: #f0f0f0;
}

.icon-preview.bg-white {
    background: #ffffff;
    border: 1px solid #e0e0e0;
}

.icon-preview.bg-dark {
    background: #2c2c2c;
}

.icon-preview.bg-checkered {
    background-image:
        linear-gradient(45deg, #ccc 25%, transparent 25%),
        linear-gradient(-45deg, #ccc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ccc 75%),
        linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    background-color: #fff;
}

.icon-preview svg {
    max-width: 100%;
    max-height: 150px;
}

.icon-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-copy {
    background-color: #27ae60;
    color: #fff;
}

.btn-copy:hover {
    background-color: #219a52;
}

.btn-delete {
    background-color: #e74c3c;
    color: #fff;
}

.btn-delete:hover {
    background-color: #c0392b;
}

/* Empty Message */
.empty-message {
    text-align: center;
    color: #999;
    padding: 40px;
    font-style: italic;
}

.empty-message.hidden {
    display: none;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    background-color: #333;
    color: #fff;
    border-radius: 6px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 1000;
}

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

.toast.success {
    background-color: #27ae60;
}

.toast.error {
    background-color: #e74c3c;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .icons-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .icon-actions {
        flex-direction: column;
    }

    .btn-small {
        width: 100%;
    }
}
