:root {
    --md-sys-color-primary: #6750A4;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: #EADDFF;
    --md-sys-color-on-primary-container: #21005D;
    --md-sys-color-secondary: #625B71;
    --md-sys-color-on-secondary: #FFFFFF;
    --md-sys-color-secondary-container: #E8DEF8;
    --md-sys-color-on-secondary-container: #1D192B;
    --md-sys-color-surface: #FFFBFE;
    --md-sys-color-on-surface: #1C1B1F;
    --md-sys-color-surface-variant: #E7E0EC;
    --md-sys-color-on-surface-variant: #49454F;
    --md-sys-color-outline: #79747E;
    --md-sys-color-background: #FFFBFE;
    --md-sys-color-error: #B3261E;
    --md-sys-color-success: #206C0A;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Roboto Flex', 'Inter', 'Helvetica Neue', 'Arial', 'sans-serif';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--md-sys-color-surface-variant);
}

.material-symbols-outlined {
    font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24
}

/* Sidebar Styles */
.sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 320px;
    height: 100%;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    z-index: 40;
    background-color: var(--md-sys-color-surface);
}

.sidebar.is-open {
    transform: translateX(0);
}

.sidebar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    z-index: 30;
    pointer-events: none;
}

.sidebar-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Animation Classes */
.modal-bg {
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content {
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from { transform: translateY(30px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.momentum-ball {
    transition: all 0.6s cubic-bezier(0.3, 0.7, 0.4, 1);
}

.step-card {
    transform-origin: bottom;
    animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.step-card.exiting {
    animation: slideOutDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOutDown {
    from { transform: translateY(0) scale(1); opacity: 1; }
    to { transform: translateY(30px) scale(0.98); opacity: 0; }
}

/* Button Styles */
.icon-btn { 
    color: var(--md-sys-color-on-surface-variant); 
    transition: color 0.2s; 
}

.icon-btn:hover { 
    color: var(--md-sys-color-on-surface); 
}

.main-btn {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
}

.main-btn:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.main-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn { 
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    transition: background-color 0.3s;
}

.secondary-btn:hover {
    background-color: rgba(0,0,0,0.08);
}

/* Form Elements */
.input-field { 
    width: 100%;
    background-color: var(--md-sys-color-surface-variant);
    border: 1px solid var(--md-sys-color-outline);
    color: var(--md-sys-color-on-surface-variant);
    border-radius: 16px;
}

.input-field:focus {
    border-color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-surface);
    outline: none;
}

.textarea-field {
    width: 100%;
    background-color: var(--md-sys-color-surface-variant);
    border: 1px solid var(--md-sys-color-outline);
    color: var(--md-sys-color-on-surface-variant);
    border-radius: 16px;
    resize: vertical;
}

/* Loading Animation */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: rotate 1s linear infinite;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    background-color: var(--md-sys-color-on-surface);
    color: var(--md-sys-color-surface);
    text-align: center;
    border-radius: 8px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 0.9;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background-color: var(--md-sys-color-surface-variant);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--md-sys-color-primary);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Error State */
.error-shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Custom range slider styles */
.range-lg::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--md-sys-color-primary);
    cursor: pointer;
    border: 4px solid var(--md-sys-color-on-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    margin-top: -10px; /* Adjust to center thumb vertically */
}

.range-lg::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--md-sys-color-primary);
    cursor: pointer;
    border: 4px solid var(--md-sys-color-on-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.range-lg::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: var(--md-sys-color-surface-variant);
    border-radius: 2px;
}

.range-lg::-moz-range-track {
    width: 100%;
    height: 4px;
    background: var(--md-sys-color-surface-variant);
    border-radius: 2px;
}

/* Theme-aware utility classes */
.main-container {
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
}

.header-bg {
    background-color: var(--md-sys-color-surface);
    border-color: var(--md-sys-color-outline);
}

.footer-bg {
    background-color: var(--md-sys-color-surface);
    border-color: var(--md-sys-color-outline);
}

.card-bg {
    background-color: var(--md-sys-color-surface);
    border-color: var(--md-sys-color-outline);
}

.text-primary {
    color: var(--md-sys-color-primary);
}

.text-secondary {
    color: var(--md-sys-color-on-surface-variant);
}
