/* Base CSS - Core variables, typography, global styles */
@font-face {
    font-family: 'Press Start 2P';
    src: url('../fonts/PressStart2P-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-normal.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Pastel Light Theme */
    --bg-primary: #fefce8;
    --bg-secondary: #fffbeb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #fde68a;
    --accent-color: #f472b6;
    --accent-hover: #ec4899;
    --accent-light: #fce7f3;
    --success-color: #34d399;
    --shadow-color: rgba(251, 191, 36, 0.15);
    --card-shadow: 0 4px 15px rgba(251, 191, 36, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #1f2937;
    --bg-secondary: #374151;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --border-color: #4b5563;
    --accent-color: #f472b6;
    --accent-hover: #ec4899;
    --accent-light: rgba(244, 114, 182, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #fef3c7 50%, var(--bg-primary) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background 0.3s, color 0.3s;
}

.left{
    order: -1;
    width:auto;
}

.right{
    margin-left: auto;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
    padding-top: 180px;
}

.melody-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Ensure toggle button is always on the right */
.section-header .toggle-btn {
    margin-left: auto;
}

.section-header h2 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

footer {
    margin-top: 2rem;
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container {
        padding-top: 100px;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .section {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 12px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
  
    
    .section-header h2 {
        font-size: 1.1rem;
    }
    
    /* Prevent horizontal scroll on body */
    body {
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .container {
        padding-top: 90px;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .section {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .section-header h2 {
        font-size: 1rem;
    }
}

/* Notification Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus styles for range sliders */
input[type="range"]:focus {
    outline: none;
}

input[type="range"]:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.3);
}

/* Range Slider Styling - Base */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(244, 114, 182, 0.4);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(244, 114, 182, 0.6);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(244, 114, 182, 0.4);
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(244, 114, 182, 0.6);
}

input[type="range"]::-moz-range-track {
    background: var(--border-color);
    border-radius: 4px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--accent-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}
