/* Rewards Creator Styles */
.creator-layout {
    display: grid;
    grid-template-columns: 300px 1fr 280px;
    gap: 20px;
    min-height: 80vh;
}

/* Panels */
.controls-panel,
.canvas-panel,
.properties-panel {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.controls-panel,
.properties-panel {
    padding: 0;
    max-height: 85vh;
    overflow-y: auto;
}

.panel-section {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.panel-section:last-child {
    border-bottom: none;
}

.panel-section h3 {
    margin: 0 0 15px 0;
    color: #667eea;
    font-size: 1.1rem;
}

/* Canvas Panel */
.canvas-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
}

.canvas-container {
    position: relative;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

#rewardCanvas {
    display: block;
    background: transparent;
    cursor: crosshair;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -1;
}

.checkerboard-bg {
    width: 100%;
    height: 100%;
    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: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.canvas-controls {
    display: flex;
    gap: 15px;
}

/* Form Elements */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Shape Tools */
.shape-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tool-btn {
    padding: 10px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.tool-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.tool-btn.active {
    background: #667eea;
    color: white;
    border-color: #5a67d8;
}

/* Color Section */
.color-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.color-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.color-group input[type="color"] {
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

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

.preset-color {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid #e9ecef;
    transition: transform 0.2s ease;
    position: relative;
}

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

.preset-color::before,
.preset-color::after {
    content: '';
    position: absolute;
    width: 50%;
    height: 100%;
    border-radius: 4px;
}

.preset-color::before {
    left: 0;
    background: var(--primary);
}

.preset-color::after {
    right: 0;
    background: var(--secondary);
}

/* Animation Controls */
.animation-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.animation-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.animation-category h5 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
}

.animation-category small {
    color: #6c757d;
    font-weight: 400;
}

.checkbox-grid, .radio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.checkbox-item, .radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.checkbox-item:hover, .radio-item:hover {
    background: #e9ecef;
}

.checkbox-item input, .radio-item input {
    margin: 0;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"]:checked + span,
.radio-item input[type="radio"]:checked + span {
    font-weight: 600;
    color: #667eea;
}

.checkbox-item:has(input:checked),
.radio-item:has(input:checked) {
    background: #e7f3ff;
    border-color: #667eea;
}

.animation-controls input[type="range"] {
    width: 100%;
}

#speedValue {
    display: inline-block;
    margin-left: 10px;
    font-weight: 600;
    color: #667eea;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* Layers List */
.layers-header {
    margin-bottom: 10px;
}

.multi-selection-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 12px;
}

.select-all-checkbox {
    margin: 0 6px 0 0;
}

.layers-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 5px;
}

.layer-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.layer-item:hover {
    background: #e9ecef;
}

.layer-item.selected {
    background: #667eea;
    color: white;
}

.layer-item.multi-selected {
    background: #28a745;
    color: white;
}

.layer-item.multi-selected:hover {
    background: #218838;
}

.layer-checkbox {
    margin: 0;
    cursor: pointer;
}

.layer-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.layer-item .layer-name {
    font-weight: 600;
}

.layer-item .layer-type {
    font-size: 12px;
    opacity: 0.7;
}

/* Properties Panel */
.properties-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.no-selection {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

/* Multi-selection info */
.multi-selection-info {
    background: #e7f3ff;
    border: 1px solid #28a745;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.multi-selection-info h4 {
    margin: 0 0 10px 0;
    color: #155724;
    font-size: 16px;
}

.multi-selection-info p {
    margin: 8px 0;
    font-size: 13px;
}

.multi-help {
    color: #6c757d;
    font-style: italic;
}

.current-source {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #b6d7ff;
}

.current-source p {
    margin: 4px 0;
}

.source-help {
    color: #6c757d;
    font-size: 12px !important;
    font-style: italic;
}

/* Preview Info */
.preview-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.preview-info p {
    margin: 5px 0;
    font-size: 14px;
}

.export-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.export-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.export-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.progress-container {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

/* Trajectory Controls */
.trajectory-controls {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.trajectory-header h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #495057;
}

.trajectory-help {
    margin: 0 0 15px 0;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

.stagger-help {
    margin: 5px 0 0 0;
    font-size: 11px;
    color: #6c757d;
    font-style: italic;
    line-height: 1.3;
}

.trajectory-point-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-small:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.btn-small.btn-secondary {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn-small.btn-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
}

.form-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.form-inline label {
    font-size: 12px;
    margin: 0;
    min-width: 60px;
}

.form-inline input[type="range"] {
    flex: 1;
    min-width: 80px;
}

.form-inline span {
    font-size: 12px;
    color: #6c757d;
    min-width: 40px;
}

.polygon-options, .spline-options {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.polygon-options label, .spline-options label {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.trajectory-status {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
    font-size: 12px;
    color: #6c757d;
}

/* Canvas trajectory visualization */
.trajectory-path {
    stroke: #007bff;
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 5,5;
}

.trajectory-point {
    fill: #007bff;
    stroke: white;
    stroke-width: 2;
}

.trajectory-point:hover {
    fill: #0056b3;
}

.trajectory-setting-mode .canvas-container {
    cursor: crosshair;
}

/* Path Offset Controls */
.path-offset-controls {
    margin-top: 15px;
    padding: 15px;
    background: #f1f8ff;
    border: 1px solid #d1ecf1;
    border-radius: 8px;
}

.offset-header h5 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #0c5460;
}

.offset-help {
    margin: 0 0 15px 0;
    font-size: 12px;
    color: #5c7cfa;
    font-style: italic;
}

.offset-params {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #d1ecf1;
}

/* Enhanced trajectory visualization */
.trajectory-center-point {
    fill: #dc3545;
    stroke: white;
    stroke-width: 3;
    opacity: 0.8;
}

.trajectory-start-point {
    fill: #28a745;
    stroke: white;
    stroke-width: 3;
    opacity: 0.8;
}

.trajectory-end-point {
    fill: #6f42c1;
    stroke: white;
    stroke-width: 3;
    opacity: 0.8;
}

.trajectory-vertex-point {
    fill: #fd7e14;
    stroke: white;
    stroke-width: 2;
    opacity: 0.8;
}

/* Point labels */
.trajectory-point-label {
    font-size: 10px;
    font-weight: bold;
    fill: white;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .creator-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .controls-panel,
    .properties-panel {
        max-height: none;
        overflow-y: visible;
    }

    .panel-section {
        padding: 15px;
    }

    .trajectory-point-controls {
        gap: 5px;
    }

    .btn-small {
        padding: 4px 8px;
        font-size: 11px;
    }
}