/* Flutter Gradient Generator Styles */

/* Preset Gradients */
.preset-gradients-container {
    overflow-x: auto;
    padding: 10px 0;
}

.preset-gradients {
    display: flex;
    gap: 15px;
    padding: 5px;
    min-width: 100%;
}

.preset-gradient {
    width: 100px;
    height: 60px;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--card-shadow);
}

.preset-gradient:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

/* Direction Grid */
.direction-control {
    margin-top: 10px;
}

.direction-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 5px;
    width: 150px;
    height: 150px;
    margin: 0 auto;
}

.direction-btn {
    width: 100%;
    height: 100%;
    border: 1px solid #ccc;
    background-color: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.direction-btn:hover {
    background-color: #e9ecef;
}

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

.direction-btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

/* Arrow indicators for direction buttons */
.direction-btn[data-direction="topLeft"]::after {
    border-width: 10px 10px 0 0;
    border-color: #666 transparent transparent transparent;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.direction-btn[data-direction="topCenter"]::after {
    border-width: 0 6px 10px 6px;
    border-color: transparent transparent #666 transparent;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.direction-btn[data-direction="topRight"]::after {
    border-width: 10px 10px 0 0;
    border-color: #666 transparent transparent transparent;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
}

.direction-btn[data-direction="centerLeft"]::after {
    border-width: 6px 10px 6px 0;
    border-color: transparent #666 transparent transparent;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.direction-btn[data-direction="centerRight"]::after {
    border-width: 6px 0 6px 10px;
    border-color: transparent transparent transparent #666;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.direction-btn[data-direction="bottomLeft"]::after {
    border-width: 10px 10px 0 0;
    border-color: #666 transparent transparent transparent;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(135deg);
}

.direction-btn[data-direction="bottomCenter"]::after {
    border-width: 10px 6px 0 6px;
    border-color: #666 transparent transparent transparent;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.direction-btn[data-direction="bottomRight"]::after {
    border-width: 10px 10px 0 0;
    border-color: #666 transparent transparent transparent;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(225deg);
}

.direction-btn.active::after {
    border-color: #fff transparent transparent transparent;
}

.direction-btn[data-direction="center"] {
    background-color: #e9ecef;
    cursor: default;
}

.direction-btn[data-direction="center"]::after {
    content: '•';
    font-size: 24px;
    color: #666;
    border: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Angle Input */
.angle-value-container {
    position: relative;
    width: 70px;
}

.angle-value-container input {
    padding-right: 20px;
}

.angle-degree {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

/* Radius Input */
.radius-value-container {
    position: relative;
    width: 70px;
}

/* Color Stops */
.color-stop {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.color-stop-input {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 15px;
}

.color-stop-position {
    flex-grow: 1;
    margin: 0 15px;
}

.color-stop-remove {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    margin-left: 10px;
}

.color-stop-remove:hover {
    color: #c82333;
}

/* Gradient Preview */
.gradient-preview {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa;
}

/* Code Display */
.flutter-code, .android-code {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

/* Copy Button */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#copyCode, #copyAndroidCode {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

/* Code Sections */
code {
    display: block;
    padding: 10px;
    background-color: #f1f1f1;
    border-radius: 4px;
    margin: 10px 0;
    white-space: pre-wrap;
    font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .direction-grid {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 768px) {
    .preset-gradient {
        width: 80px;
        height: 50px;
    }
}

@media (max-width: 576px) {
    .direction-grid {
        width: 100px;
        height: 100px;
    }

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

    .color-stop-position {
        width: 100%;
        margin: 10px 0;
    }
}
