/**
 * Font Cadencer - Editor Styles
 * Phase 7.2
 */

/* Editor Controls */
.editor-controls {
    background: linear-gradient(135deg, #2a2a2a 0%, #353535 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: flex-end;
}

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

.control-group label {
    color: #999;
    font-size: 0.9em;
    font-weight: 600;
}

.control-group select,
.control-group input[type="text"] {
    padding: 10px 15px;
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1em;
}

.btn-secondary {
    padding: 10px 20px;
    background: #444;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

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

/* Editor Section */
.editor-section {
    background: linear-gradient(135deg, #2a2a2a 0%, #353535 100%);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

/* Toolbar */
.editor-toolbar {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #444;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.toolbar-group label {
    color: #999;
    font-weight: 600;
}

.toolbar-group select,
.toolbar-group input {
    padding: 8px 12px;
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 6px;
    color: #e0e0e0;
}

/* Editor Grid */
.editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Glyph Editor Card */
.glyph-editor-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #333;
    transition: all 0.3s;
}

.glyph-editor-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.glyph-editor-card.modified {
    border-color: #ff9800;
    background: linear-gradient(135deg, #2d2200 0%, #332800 100%);
}

/* Glyph Preview */
.glyph-preview {
    text-align: center;
    padding: 15px;
    background: #0d0d0d;
    border-radius: 8px;
    margin-bottom: 15px;
}

.glyph-char {
    font-size: 3em;
    color: #667eea;
    font-weight: bold;
    display: block;
}

.glyph-name {
    font-size: 0.9em;
    color: #999;
    display: block;
    margin-top: 5px;
}

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

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-group label {
    color: #667eea;
    font-weight: 600;
    font-size: 0.9em;
}

/* Range Slider */
.slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #333 0%, #555 100%);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
    transition: all 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.7);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.slider:active::-webkit-slider-thumb {
    background: #764ba2;
}

/* Slider Value Input */
.slider-value {
    width: 80px;
    padding: 8px;
    background: #0d0d0d;
    border: 2px solid #444;
    border-radius: 6px;
    color: #667eea;
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
}

.slider-value:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
}

/* Glyph Info */
.glyph-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #333;
}

.side-def {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.btn-reset {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s;
}

.btn-reset:hover {
    background: rgba(244, 67, 54, 0.4);
    transform: scale(1.1);
}

/* Modified indicator */
.glyph-editor-card.modified::before {
    content: "●";
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ff9800;
    font-size: 1.5em;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Responsive */
@media (max-width: 768px) {
    .editor-grid {
        grid-template-columns: 1fr;
    }
    
    .editor-controls,
    .editor-toolbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
.message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.3s ease-out;
    z-index: 1000;
}

.message-toast.success {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.message-toast.error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
