/* ==========================================================================
   1. Root Variables & Base Settings
   ========================================================================== */
:root {
    --ios-bg: #f5f5f7;
    --ios-card: #ffffff;
    --ios-text: #1d1d1f;
    --ios-muted: #8e8e93;
    --ios-primary: #4f46e5;
    --ios-gradient: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    --widget-radius: 28px;
    --card-radius: 22px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--ios-bg);
    color: var(--ios-text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.2px;
    overflow-x: hidden;
    padding-bottom: 110px; /* Safe padding to prevent overlap with the bottom floating dock */
}

/* Minimalist iOS-style Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   2. Layout & Header Components
   ========================================================================== */
/* Glassmorphic Top Navbar */
.navbar-ios {
    background: rgba(245, 245, 247, 0.85) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1030;
}

/* ==========================================================================
   3. Cards, Containers, and Widgets
   ========================================================================== */
/* Standard iOS Card container */
.card-ios {
    background-color: var(--ios-card);
    border-radius: var(--widget-radius);
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.015);
    padding: 24px;
}

/* Interactive Widget Card */
.widget-card {
    background-color: var(--ios-card);
    border-radius: var(--widget-radius);
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.015);
    padding: 24px;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.25s ease;
}
.widget-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.04);
}

/* Glassmorphic Horizontal Row Card */
.glassy-card {
    background: rgba(255, 255, 255, 0.45) !important; 
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: var(--card-radius);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.02);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.glassy-card:hover {
    transform: scale(1.03);
    background: rgba(255, 255, 255, 0.75) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.04);
    border-color: rgba(255, 255, 255, 0.7) !important;
}

/* Glassmorphic Vertical Grid Card */
.glassy-card-vertical {
    background: rgba(255, 255, 255, 0.45) !important; 
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: var(--card-radius);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.02);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.glassy-card-vertical:hover {
    transform: scale(1.03);
    background: rgba(255, 255, 255, 0.75) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.04);
    border-color: rgba(255, 255, 255, 0.7) !important;
}

/* ==========================================================================
   4. Buttons, Inputs & Controls
   ========================================================================== */
/* Premium Accent Action Button */
.btn-premium {
    background: var(--ios-gradient);
    border: none;
    color: #ffffff !important;
    font-weight: 600;
    border-radius: 14px;
    padding: 12px 24px;
    transition: transform 0.1s ease, opacity 0.2s ease;
    cursor: pointer;
}
.btn-premium:active {
    transform: scale(0.97);
    opacity: 0.9;
}

/* Outlined minimalist Button */
.btn-ios-outline {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--ios-text);
    font-weight: 600;
    border-radius: 14px;
    padding: 12px 24px;
    font-size: 13px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
    cursor: pointer;
}
.btn-ios-outline:hover {
    background-color: #f5f5f7;
}
.btn-ios-outline:active {
    transform: scale(0.97);
}

/* Form Controls with iOS visual cues */
.form-control-ios {
    background-color: #f5f5f7;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 15px;
    width: 100%;
    transition: all 0.2s ease;
}
.form-control-ios:focus {
    background-color: #ffffff;
    border-color: var(--ios-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    outline: none;
}

/* iOS Segmented Selector tab bar controls */
.ios-segmented-control {
    background-color: #eaeaea;
    border-radius: 12px;
    padding: 3px;
    display: flex;
    justify-content: space-around;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.02);
}
.ios-segmented-control input[type="radio"] {
    display: none;
}
.ios-segmented-control label {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #515154;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    user-select: none;
}
.ios-segmented-control input[type="radio"]:checked + label {
    background-color: #ffffff;
    color: #1d1d1f;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   5. Interactive Instrument Layouts
   ========================================================================== */
.piano-container {
    display: flex;
    position: relative;
    background-color: #1d1d1f;
    padding: 4px;
    border-radius: 12px;
    height: 120px;
    width: 100%;
    user-select: none;
}
.piano-key-white {
    flex: 1;
    background: #ffffff;
    border: 1px solid #d1d1d6;
    border-radius: 0 0 6px 6px;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: background 0.1s ease;
}
.piano-key-white:active, .piano-key-white.active {
    background: #e5e5ea;
}
.piano-key-black {
    width: 6.5%;
    height: 60%;
    background: #1d1d1f;
    border-radius: 0 0 4px 4px;
    cursor: pointer;
    position: absolute;
    z-index: 2;
    transition: background 0.1s ease;
}
.piano-key-black:active, .piano-key-black.active {
    background: #515154;
}
.piano-key-label {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: bold;
    color: #8e8e93;
}

/* ==========================================================================
   6. Navigation Bottom Dock
   ========================================================================== */
.ios-floating-dock {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 440px;
    height: 70px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1050;
    padding: 0 12px;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--ios-muted);
    font-size: 10px;
    font-weight: 700;
    transition: color 0.2s ease, transform 0.2s ease;
    flex: 1;
    text-align: center;
}
.dock-item i {
    font-size: 20px;
    margin-bottom: 2px;
}
.dock-item:hover, .dock-item.active {
    color: var(--ios-primary);
}

/* Prominent action item (e.g., Log out/My account) */
.dock-item.highlighted-account {
    background: var(--ios-gradient);
    color: #ffffff !important;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
    transform: translateY(-14px); 
    border: 4px solid var(--ios-bg); 
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex: none; 
}
.dock-item.highlighted-account:hover {
    transform: translateY(-18px) scale(1.05);
}

/* ==========================================================================
   7. Typography & Utility Elements
   ========================================================================== */
.text-gradient {
    background: var(--ios-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cursor-pointer {
    cursor: pointer !important;
}

.xsmall { 
    font-size: 11px; 
}