/* ==========================================================================
   1. Root Variables & Base Styles
   ========================================================================== */
: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; /* Standardized to the larger 28px radius from file 2 */
}

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;
    letter-spacing: -0.2px;
    overflow-x: hidden;
    padding-bottom: 90px; /* Safe padding at bottom to prevent floating dock overlap on mobile */
}

/* Glassmorphic Top Navbar */
.navbar-ios {
    background: rgba(245, 245, 247, 0.8) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1030;
}

/* ==========================================================================
   2. Cards & Widgets
   ========================================================================== */
/* Original Card Style */
.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;
}

/* Modular Android-style 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);
}

/* Modern Glassmorphic Widget Card - Horizontal */
.glassy-card {
    background: rgba(255, 255, 255, 0.45) !important; 
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 22px;
    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.04);
    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;
}

/* Modern Glassmorphic Widget Card - Vertical style for Course grid */
.glassy-card-vertical {
    background: rgba(255, 255, 255, 0.45) !important; 
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.02);
    padding: 12px;
    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.04);
    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;
}

/* ==========================================================================
   3. Buttons & Inputs
   ========================================================================== */
/* Premium Accent Buttons */
.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;
}
.btn-premium:active {
    transform: scale(0.97);
    opacity: 0.9;
}

/* Outlined iOS-style 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;
}
.btn-ios-outline:hover {
    background-color: #f5f5f7;
    color: var(--ios-text);
}

/* Badge Buttons */
.btn-ios-badge {
    border-radius: 10px;
    padding: 8px 14px;
    border: 1px solid rgba(0, 0, 0, 0.02);
    background-color: #f5f5f7;
    color: #1d1d1f;
    cursor: pointer;
    font-size: 12px;
}
.btn-check:checked + .btn-ios-badge {
    background: var(--ios-gradient) !important;
    color: #ffffff !important;
}

/* Form Controls */
.form-control-ios {
    background-color: #f5f5f7;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 15px;
    transition: all 0.2s ease;
}
.form-control-ios:focus {
    background-color: #ffffff;
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    outline: none;
}

/* ==========================================================================
   4. Specialized UI Components
   ========================================================================== */
/* iOS Segmented Control styled tab bar */
.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);
}

/* Curved Carousel */
.carousel-wrapper {
    border-radius: 36px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    margin-top: 100px;
}
.carousel-item-ios {
    height: 500px; /* Increased Height on Desktop */
    background-size: cover;
    background-position: center;
    position: relative;
}
.carousel-item-ios::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.7) 100%);
}
.carousel-caption-ios {
    position: absolute;
    bottom: 60px;
    left: 50px;
    right: 50px;
    z-index: 10;
    color: #ffffff;
    text-align: left;
}

/* Sleek Piano Keyboard Layout */
.piano-container {
    display: flex;
    position: relative;
    background-color: #1d1d1f;
    padding: 4px;
    border-radius: 12px;
    height: 150px;
    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: 7%;
    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;
}

/* Floating Curved 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;
    flex: 1;
    text-align: center;
}
.dock-item i {
    font-size: 20px;
    margin-bottom: 2px;
}
.dock-item:hover, .dock-item.active {
    color: var(--ios-primary);
}

/* Highlighted "My Account" Option */
.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);
}
.dock-item.highlighted-account i {
    margin-bottom: 0;
    font-size: 22px;
}
.dock-item.highlighted-account span {
    display: none; 
}

/* ==========================================================================
   5. Utilities & Helper Classes
   ========================================================================== */
.cursor-pointer {
    cursor: pointer !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cursor-pointer:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
}

.xsmall { 
    font-size: 11px; 
}

.text-gradient {
    background: var(--ios-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Element Specific Display Toggles */
#modalBatchesBody tr td:nth-child(3) {
    display: none;
}

#selectedBatchesContainer > div > div > span {
    display: none;
}

/* ==========================================================================
   6. Media Queries
   ========================================================================== */
@media (max-width: 767.98px) {
    .carousel-wrapper {
        border-radius: 24px;
        margin-top: 80px;
    }
    .carousel-item-ios {
        height: 320px; 
    }
    .carousel-caption-ios {
        bottom: 30px;
        left: 24px;
        right: 24px;
    }
}