/* ========================================
   GRADIENT MAKER PAGE STYLES
   그라데이션 생성기 페이지 스타일
   ======================================== */

/* ===== Wide Container Override ===== */
.container--wide {
    max-width: 1400px;
}

/* ===== Layout ===== */
.gradient-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 32px;
    align-items: start;
}

/* ===== Control Panel ===== */
.gradient-controls {
    width: 380px;
    min-width: 380px;
    max-width: 380px;
    order: 2;
}

.control-panel {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid rgba(45, 52, 54, 0.06);
    box-shadow: var(--shadow-soft);
    width: 100%;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 20px 0;
}

/* ===== Color Stops ===== */
.color-stops {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.color-stop {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    transition: box-shadow 0.2s ease;
}

.color-stop:hover {
    box-shadow: 0 2px 12px rgba(45, 52, 54, 0.08);
}

.color-stop__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.color-stop__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.color-stop__actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.color-stop__move {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid rgba(45, 52, 54, 0.1);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.color-stop__move:hover:not(:disabled) {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: #fff;
}

.color-stop__move:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.color-stop__remove {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.color-stop__remove:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

.color-stop__picker {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.color-input {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
}

.color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

.color-hex {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid rgba(45, 52, 54, 0.1);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    text-transform: uppercase;
}

.color-hex:focus {
    outline: none;
    border-color: var(--accent-secondary);
}

.color-stop__position {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-stop__position label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 30px;
}

.position-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-card);
    border-radius: 3px;
    cursor: pointer;
}

.position-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-secondary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.position-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.position-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

/* ===== Add Color Button ===== */
.btn-add-color {
    width: 100%;
    padding: 12px;
    background: var(--bg-secondary);
    border: 2px dashed rgba(45, 52, 54, 0.15);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 24px;
}

.btn-add-color:hover {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    background: rgba(78, 205, 196, 0.05);
}

.btn-add-color span {
    font-size: 1.2rem;
}

/* ===== Control Section ===== */
.control-section {
    margin-bottom: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(45, 52, 54, 0.08);
}

.control-section:last-child {
    margin-bottom: 0;
}

.control-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 14px 0;
}

/* ===== Direction Grid ===== */
.direction-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.direction-btn {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.direction-btn:hover {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
}

.direction-btn.active {
    background: var(--accent-secondary);
    color: #fff;
    border-color: var(--accent-secondary);
}

.angle-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

.angle-input input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-secondary);
    border-radius: 3px;
    cursor: pointer;
}

.angle-input input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-secondary);
    border-radius: 50%;
    cursor: pointer;
}

.angle-input span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 45px;
}

/* ===== Type Buttons ===== */
.type-buttons {
    display: flex;
    gap: 8px;
}

.type-btn {
    flex: 1;
    padding: 12px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.type-btn:hover {
    border-color: var(--accent-secondary);
}

.type-btn.active {
    background: var(--accent-secondary);
    color: #fff;
    border-color: var(--accent-secondary);
}

/* ===== Preset Grid ===== */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.preset-item {
    aspect-ratio: 1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.preset-item:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(45, 52, 54, 0.15);
}

.preset-item.active {
    border-color: var(--text-primary);
}

/* ===== Result Section ===== */
.gradient-result {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    width: 100%;
    position: sticky;
    top: 100px;
    order: 1;
}

/* ===== Preview Panel ===== */
.preview-panel {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid rgba(45, 52, 54, 0.06);
    box-shadow: var(--shadow-soft);
}

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

.preview-header .panel-title {
    margin: 0;
}

.btn-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.3rem;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--accent-secondary);
    transform: scale(1.05);
}

.preview-box {
    height: 280px;
    border-radius: 16px;
    background: linear-gradient(180deg, #FF6B6B 0%, #4ECDC4 100%);
    box-shadow: 0 8px 30px rgba(45, 52, 54, 0.15);
    transition: background 0.3s ease;
    width: 100%;
}

/* ===== Code Panel ===== */
.code-panel {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid rgba(45, 52, 54, 0.06);
    box-shadow: var(--shadow-soft);
}

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

.code-header .panel-title {
    margin: 0;
}

.btn-copy {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--accent-secondary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: var(--accent-primary);
}

.code-block {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
    color: #d4d4d4;
    overflow-x: auto;
    margin: 0;
    word-break: break-all;
    white-space: pre-wrap;
}

.code-block .property {
    color: #9cdcfe;
}

.code-block .value {
    color: #ce9178;
}

/* ===== Examples Panel ===== */
.examples-panel {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid rgba(45, 52, 54, 0.06);
    box-shadow: var(--shadow-soft);
}

.examples-panel .panel-title {
    margin-bottom: 20px;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.example-item {
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.example-item__preview {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.example-item__button {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.example-item__button:hover {
    transform: scale(1.05);
}

.example-item__text {
    font-size: 2rem;
    font-weight: 800;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.example-item__card {
    width: 90%;
    padding: 16px;
    border-radius: 10px;
    color: #fff;
}

.example-item__info {
    padding: 14px;
    text-align: center;
}

.example-item__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Mobile Floating Preview Bar ===== */
.mobile-preview-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 12px 16px;
    background: var(--bg-card);
    border-top: 1px solid rgba(45, 52, 54, 0.1);
    box-shadow: 0 -4px 20px rgba(45, 52, 54, 0.15);
    align-items: center;
    gap: 12px;
}

.mobile-preview-bar__gradient {
    flex: 1;
    height: 50px;
    border-radius: 10px;
    background: linear-gradient(180deg, #FF6B6B 0%, #4ECDC4 100%);
    box-shadow: 0 2px 10px rgba(45, 52, 54, 0.15);
}

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

.mobile-preview-bar__btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.mobile-preview-bar__btn:hover,
.mobile-preview-bar__btn:active {
    background: var(--accent-secondary);
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .container--wide {
        max-width: 100%;
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (max-width: 1100px) {
    .gradient-layout {
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 24px;
    }

    .gradient-controls {
        width: 340px;
        min-width: 340px;
        max-width: 340px;
    }
}

@media (max-width: 900px) {
    .gradient-layout {
        grid-template-columns: 1fr;
    }

    .gradient-result {
        position: static;
        order: 2;
    }

    .gradient-controls {
        width: 100%;
        min-width: unset;
        max-width: unset;
        order: 1;
    }

    .control-panel {
        width: 100%;
    }

    .preview-box {
        height: 250px;
    }

    .examples-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Add bottom padding for floating bar */
    .gradient-controls {
        padding-bottom: 100px;
    }

    /* Show mobile preview bar on mobile only */
    .mobile-preview-bar {
        display: flex;
    }
}

@media (max-width: 600px) {
    .control-panel {
        padding: 20px;
    }

    .direction-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .preset-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .preview-box {
        height: 200px;
    }

    .examples-grid {
        grid-template-columns: 1fr;
    }

    .code-block {
        font-size: 0.75rem;
        padding: 16px;
    }
}

