/* ═══════════════════════════════════════════════════════════════
   Rose Curve Animator - Beige & Gold Theme
   Matching Creative Agni's aesthetic
   ═══════════════════════════════════════════════════════════════ */

:root {
    --beige-light: #F5EFE6;
    --beige-medium: #E8DCC8;
    --beige-dark: #D4C5A9;
    --gold: #C9A961;
    --gold-dark: #B8944A;
    --gold-light: #D9BC7A;
    --brown: #5C4A3A;
    --brown-dark: #3D2F24;
    --shadow: rgba(184, 148, 74, 0.15);
    --shadow-strong: rgba(184, 148, 74, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--beige-light) 0%, var(--beige-medium) 100%);
    color: var(--brown);
    min-height: 100vh;
    padding: 1rem;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ═══ Header ═══ */
header {
    text-align: center;
    margin-bottom: 1rem;
}

header h1 {
    font-size: 2rem;
    color: var(--gold-dark);
    margin-bottom: 0.2rem;
    text-shadow: 2px 2px 4px var(--shadow);
}

.subtitle {
    font-size: 0.95rem;
    color: var(--brown);
    opacity: 0.8;
}

/* ═══ Workspace Layout ═══ */
.workspace {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    align-items: start;
    max-height: 85vh;
}

/* ═══ Preview Section ═══ */
.preview-section {
    background: white;
    border-radius: 20px;
    border: 3px solid var(--gold);
    padding: 1.5rem;
    box-shadow: 0 8px 30px var(--shadow-strong);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-height: 85vh;
    overflow: hidden;
}

#canvas {
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow);
    max-width: 100%;
    max-height: calc(85vh - 120px);  /* Leave room for dimension info */
    height: auto;
    width: auto;
    object-fit: contain;
}

.canvas-info {
    font-size: 0.9rem;
    color: var(--brown);
    opacity: 0.7;
}

/* ═══ Controls Panel ═══ */
.controls-panel {
    background: white;
    border-radius: 20px;
    border: 3px solid var(--gold);
    padding: 1.25rem;
    box-shadow: 0 8px 30px var(--shadow-strong);
    max-height: 85vh;  /* Match preview section */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.control-group {
    margin-bottom: 1.25rem;
}

.control-group h3 {
    color: var(--gold-dark);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.control-group label {
    display: block;
    color: var(--brown);
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.control-group label span {
    color: var(--gold-dark);
    font-weight: 700;
}

.control-group small {
    display: block;
    color: var(--brown);
    opacity: 0.6;
    font-size: 0.72rem;
    margin-top: 0.2rem;
}

/* ═══ Radio Buttons ═══ */
.radio-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.radio-option {
    flex: 1;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.4rem;
    background: var(--beige-light);
    border: 2px solid var(--gold);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.radio-option:hover {
    background: var(--beige-medium);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.radio-option input[type="radio"] {
    margin-right: 0.4rem;
    accent-color: var(--gold);
}

.radio-option input[type="radio"]:checked + span {
    color: var(--gold-dark);
    font-weight: 700;
}

/* ═══ Select Dropdown ═══ */
.styled-select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--beige-light);
    border: 2px solid var(--gold);
    border-radius: 10px;
    color: var(--brown);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.styled-select:hover {
    background: var(--beige-medium);
    box-shadow: 0 4px 12px var(--shadow);
}

.styled-select:focus {
    outline: none;
    border-color: var(--gold-dark);
    box-shadow: 0 0 0 3px var(--shadow);
}

/* ═══ Sliders (Glamorous!) ═══ */
.slider {
    width: 100%;
    height: 8px;
    border-radius: 20px;
    background: var(--beige-medium);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

/* Slider Track */
.slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, var(--gold-light), var(--gold-dark));
    border-radius: 20px;
}

.slider::-moz-range-track {
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, var(--gold-light), var(--gold-dark));
    border-radius: 20px;
}

/* Slider Thumb */
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--gold);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 3px 10px var(--shadow-strong);
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--gold);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 3px 10px var(--shadow-strong);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--gold-dark);
}

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

/* ═══ Buttons ═══ */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: white;
    box-shadow: 0 6px 20px var(--shadow-strong);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-strong);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: var(--beige-dark);
    color: var(--brown);
}

.btn-secondary {
    background: var(--beige-medium);
    color: var(--brown);
    border: 2px solid var(--gold);
}

.btn-secondary:hover {
    background: var(--beige-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

/* ═══ Status Message ═══ */
.status-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.status-message.show {
    display: block;
}

.status-message.info {
    background: var(--beige-light);
    color: var(--brown);
    border: 2px solid var(--gold-light);
}

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

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

/* ═══ Curve Selector ═══ */
.curve-selector {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.curve-selector h3 {
    color: var(--gold-dark);
    font-size: 1.1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.curve-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.curve-option {
    display: flex;
    align-items: center;
    padding: 0.85rem;
    background: var(--beige-light);
    border: 2px solid var(--gold);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.curve-option:hover {
    background: var(--beige-medium);
    transform: translateX(5px);
    box-shadow: 0 4px 12px var(--shadow);
}

.curve-option input[type="radio"] {
    margin-right: 0.75rem;
    accent-color: var(--gold);
    transform: scale(1.2);
}

.curve-option input[type="radio"]:checked ~ .curve-info {
    color: var(--gold-dark);
}

.curve-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.curve-info strong {
    font-size: 0.95rem;
    color: var(--brown-dark);
}

.curve-info small {
    font-size: 0.75rem;
    color: var(--brown);
    opacity: 0.7;
}

.curve-option input[type="radio"]:checked ~ .curve-info strong {
    color: var(--gold-dark);
    font-weight: 700;
}

/* ═══ Parameter Controls ═══ */
.parameter-controls {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.current-curve-header {
    text-align: center;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gold-light);
    margin-bottom: 0.5rem;
}

.current-curve-header h3 {
    color: var(--gold-dark);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ═══ Reset Section ═══ */
.reset-section {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 2px solid var(--beige-medium);
}

/* ═══ Credits ═══ */
.credits {
    margin-top: 0.75rem;
    padding: 0.5rem 0;
    text-align: center;
    font-size: 0.7rem;
    color: var(--brown);
    opacity: 0.7;
    line-height: 1.4;
    border-top: 1px solid var(--gold-light);
    width: 100%;
}

/* ═══ Responsive ═══ */
@media (max-width: 1024px) {
    .workspace {
        grid-template-columns: 1fr;
    }

    .controls-panel {
        order: 2;
    }

    .preview-section {
        order: 1;
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .controls-panel,
    .preview-section {
        padding: 1.5rem;
    }
}
