.gradient-tool-card {
    margin-bottom: 2rem;
}

.tool-card-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.tool-card-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.tool-card-left,
.tool-card-right {
    display: flex;
    flex-direction: column;
}

.input-section,
.results-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-header {
    margin-bottom: 8px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
}

.section-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-group-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-value {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
}

.type-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.type-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid #e5e7eb;
    background: #ffffff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.type-option:hover {
    border-color: #667eea;
    background: #f9fafb;
}

.type-option.active {
    border-color: #667eea;
    background: #eff6ff;
}

.type-visual {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}

.linear-visual {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.radial-visual {
    background: radial-gradient(circle, #667eea 0%, #764ba2 100%);
}

.conic-visual {
    background: conic-gradient(from 0deg, #667eea, #764ba2, #667eea);
}

.repeating-linear-visual {
    background: repeating-linear-gradient(45deg, #667eea 0px, #667eea 10px, #764ba2 10px, #764ba2 20px);
}

.type-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

.type-option.active .type-label {
    color: #667eea;
}

.angle-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.control-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.angle-presets {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}

.angle-preset {
    aspect-ratio: 1;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.angle-preset:hover {
    border-color: #667eea;
    background: #f9fafb;
}

.angle-preset.active {
    border-color: #667eea;
    background: #eff6ff;
    color: #667eea;
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;justify-items: center;
}

.position-btn {
    aspect-ratio: 1;
    border: 2px solid #e5e7eb;
    background: #ffffff;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
}

.position-btn:hover {
    border-color: #667eea;
    background: #f9fafb;
}

.position-btn.active {
    border-color: #667eea;
    background: #eff6ff;
    color: #667eea;
}

.shape-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.shape-option {
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    background: #ffffff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shape-option:hover {
    border-color: #667eea;
    background: #f9fafb;
}

.shape-option.active {
    border-color: #667eea;
    background: #eff6ff;
    color: #667eea;
}

.control-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    background: #ffffff;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-select:focus {
    outline: none;
    border-color: #667eea;
}

.add-color-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #667eea;
    background: #667eea;
    border-radius: 8px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-color-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.add-color-btn svg {
    flex-shrink: 0;
}

.color-stops-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.color-stop-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.color-stop-preview {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.color-stop-preview:hover {
    transform: scale(1.1);
}

.color-stop-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 6px;
    font-size: 14px;
    
    color: #374151;
}

.color-stop-input:focus {
    outline: none;
    border-color: #667eea;
}

.color-stop-position {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
}

.position-slider {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.position-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.position-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.position-display {
    min-width: 40px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

.remove-stop-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #ef4444;
    background: #ffffff;
    border-radius: 6px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.remove-stop-btn:hover {
    background: #ef4444;
    color: #ffffff;
}

.preview-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.preview-actions {
    display: flex;
    gap: 8px;
}

.action-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-icon-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}

.gradient-preview {
    width: 100%;
    height: 280px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gradient-preview:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.15);
}

.preview-info {
    display: flex;
    gap: 8px;
}

.info-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

.code-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.code-editor {
    background: #1f2937;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #374151;
    min-height: 120px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

.code-editor::-webkit-scrollbar {
    width: 8px;
}

.code-editor::-webkit-scrollbar-track {
    background: #111827;
    border-radius: 4px;
}

.code-editor::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

.code-editor::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.code-editor pre {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #e5e7eb;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all;
}

.code-editor code {
    color: #10b981;
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.preset-item {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.preset-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.preset-item::after {
    content: attr(data-name);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.preset-item:hover::after {
    opacity: 1;
}

.export-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.export-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.export-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.export-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    background: #ffffff;
    border-radius: 10px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.export-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.export-btn:hover {
    border-color: #667eea;
    background: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.export-btn:hover::before {
    opacity: 1;
}

.export-btn:hover .export-icon {
    transform: scale(1.1);
}

.export-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f3f4f6;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.export-btn:hover .export-icon {
    background: #eff6ff;
}

.css-icon {
    color: #2563eb;
}

.scss-icon {
    color: #c2410c;
}

.png-icon {
    color: #059669;
}

.svg-icon {
    color: #7c3aed;
}

.export-btn:hover .css-icon {
    color: #2563eb;
    background: #dbeafe;
}

.export-btn:hover .scss-icon {
    color: #c2410c;
    background: #fed7aa;
}

.export-btn:hover .png-icon {
    color: #059669;
    background: #d1fae5;
}

.export-btn:hover .svg-icon {
    color: #7c3aed;
    background: #ede9fe;
}

.export-icon svg {
    flex-shrink: 0;
}

.export-text {
    font-size: 14px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.export-btn:hover .export-text {
    color: #111827;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #111827;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

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

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-content svg {
    flex-shrink: 0;
    color: #10b981;
}

@media (max-width: 1024px) {
    .tool-card-columns {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .tool-card-container {
        padding: 24px;
    }
}

@media (max-width: 640px) {
    .tool-card-container {
        padding: 16px;
    }

    .section-title {
        font-size: 18px;
    }

    .gradient-preview {
        height: 240px;
    }

    .type-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .color-stop-item {
        flex-wrap: wrap;
    }

    .color-stop-position {
        width: 100%;
    }

    .presets-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .preset-item {
        height: 50px;
    }

    .control-group-header .action-icon-btn {
        width: 32px;
        height: 32px;
    }

    .export-options {
        grid-template-columns: 1fr;
    }

    .export-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        transform: translateY(100px);
    }

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