/* ============================================
   iOS 18 Glassmorphism Design System
   ============================================ */

/* Root Variables - iOS Color Palette */
:root {
    /* iOS System Colors */
    --ios-blue: #007AFF;
    --ios-green: #34C759;
    --ios-indigo: #5856D6;
    --ios-orange: #FF9500;
    --ios-pink: #FF2D55;
    --ios-purple: #AF52DE;
    --ios-red: #FF3B30;
    --ios-teal: #5AC8FA;
    --ios-yellow: #FFCC00;

    /* Background Colors */
    --ios-bg-primary: #F2F2F7;
    --ios-bg-secondary: #FFFFFF;
    --ios-bg-tertiary: #F9F9F9;

    /* Text Colors */
    --ios-text-primary: #000000;
    --ios-text-secondary: #3C3C43;
    --ios-text-tertiary: #8E8E93;

    /* Glass Effect Variables */
    --glass-blur: 40px;
    --glass-opacity: 0.7;
    --glass-border: rgba(255, 255, 255, 0.18);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);

    /* Border Radius */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
}

/* ============================================
   Base Styles
   ============================================ */

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
    font-size: 17px;
    line-height: 1.47;
    color: var(--ios-text-primary);
    background: linear-gradient(180deg, #E3F2FD 0%, #F5F5F5 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Glass Container
   ============================================ */

.glass-container {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-2xl);
    max-width: 430px;
    margin: 0 auto;
    overflow: hidden;
}

@media (max-width: 430px) {
    .glass-container {
        border-radius: 0;
        max-width: 100%;
        min-height: 100vh;
    }
}

/* ============================================
   Navigation Bar (iOS Style)
   ============================================ */

.navbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
    padding: 12px 16px;
}

.navbar-brand {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.4px;
    color: var(--ios-text-primary) !important;
}

.nav-link {
    font-size: 16px;
    font-weight: 500;
    color: var(--ios-text-secondary) !important;
    padding: 8px 12px !important;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(0, 122, 255, 0.1);
    color: var(--ios-blue) !important;
}

.nav-link.active {
    background: rgba(0, 122, 255, 0.15);
    color: var(--ios-blue) !important;
    font-weight: 600;
}

/* ============================================
   Glass Cards
   ============================================ */

.glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

/* Removed gradient line from top of glass cards */

.glass-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.4);
}

.glass-card:active {
    transform: translateY(-2px) scale(1.01);
}

/* ============================================
   Card Variants
   ============================================ */

.card {
    border: none;
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card.glass-card.profession {
    background: linear-gradient(135deg,
        rgba(52, 199, 89, 0.85) 0%,
        rgba(52, 199, 89, 0.95) 100%
    );
    backdrop-filter: blur(20px);
    color: white;
}

.card.glass-card.qualification {
    background: linear-gradient(135deg,
        rgba(88, 86, 214, 0.85) 0%,
        rgba(88, 86, 214, 0.95) 100%
    );
    backdrop-filter: blur(20px);
    color: white;
}

.card.glass-card.job {
    background: linear-gradient(135deg,
        rgba(255, 45, 85, 0.85) 0%,
        rgba(255, 45, 85, 0.95) 100%
    );
    backdrop-filter: blur(20px);
    color: white;
}

.card.glass-card.educator {
    background: linear-gradient(135deg,
        rgba(90, 200, 250, 0.85) 0%,
        rgba(90, 200, 250, 0.95) 100%
    );
    backdrop-filter: blur(20px);
    color: white;
}

.card.glass-card.credential {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
}

/* Tile Cards */
.card.tile-card,
.card.tile {
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card.tile-card::after,
.card.tile::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

/* Icon Cards */
.card.icon {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 0.8rem;
    position: relative;
    overflow: hidden;
}

.card.icon img {
    max-height: 60%;
    max-width: 80%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* ============================================
   Buttons (iOS Style)
   ============================================ */

.btn {
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    transition: all 0.2s ease;
    letter-spacing: -0.2px;
}

.btn-primary {
    background: var(--ios-blue);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    background: #0062CC;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 122, 255, 0.3);
}

.btn-outline-dark {
    border: 1.5px solid rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.8);
    color: var(--ios-text-primary);
}

.btn-outline-dark:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
}

.btn-danger {
    background: var(--ios-red);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
}

.btn-danger:hover {
    background: #E8382F;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.4);
}

/* ============================================
   Badges (iOS Style)
   ============================================ */

.badge {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    letter-spacing: -0.1px;
}

.badge.bg-success {
    background: var(--ios-green) !important;
    box-shadow: 0 2px 6px rgba(52, 199, 89, 0.3);
}

.badge.bg-primary {
    background: var(--ios-blue) !important;
    box-shadow: 0 2px 6px rgba(0, 122, 255, 0.3);
}

.badge.bg-info {
    background: var(--ios-teal) !important;
    box-shadow: 0 2px 6px rgba(90, 200, 250, 0.3);
}

.badge.bg-warning {
    background: var(--ios-orange) !important;
    color: white !important;
    box-shadow: 0 2px 6px rgba(255, 149, 0, 0.3);
}

.badge.bg-secondary {
    background: rgba(142, 142, 147, 0.3) !important;
    color: var(--ios-text-secondary) !important;
}

/* ============================================
   Alerts (iOS Style)
   ============================================ */

.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: linear-gradient(135deg,
        rgba(52, 199, 89, 0.1) 0%,
        rgba(52, 199, 89, 0.05) 100%
    );
    color: #1F7A3D;
    border-left: 3px solid var(--ios-green);
}

.alert-info {
    background: linear-gradient(135deg,
        rgba(0, 122, 255, 0.1) 0%,
        rgba(0, 122, 255, 0.05) 100%
    );
    color: #0051A5;
    border-left: 3px solid var(--ios-blue);
}

.alert-warning {
    background: linear-gradient(135deg,
        rgba(255, 149, 0, 0.1) 0%,
        rgba(255, 149, 0, 0.05) 100%
    );
    color: #A66000;
    border-left: 3px solid var(--ios-orange);
}

.alert-danger {
    background: linear-gradient(135deg,
        rgba(255, 59, 48, 0.1) 0%,
        rgba(255, 59, 48, 0.05) 100%
    );
    color: #C91F1F;
    border-left: 3px solid var(--ios-red);
}

/* ============================================
   Typography (iOS Style)
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--ios-text-primary);
}

h1 {
    font-size: 34px;
    line-height: 1.15;
    margin-bottom: 8px;
}

h2 {
    font-size: 28px;
    line-height: 1.2;
    margin-bottom: 8px;
}

h3 {
    font-size: 22px;
    line-height: 1.25;
    margin-bottom: 6px;
}

h4 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

h5 {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin-bottom: 8px;
}

.card-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: var(--ios-text-secondary);
    letter-spacing: -0.1px;
}

/* ============================================
   Modal (iOS Style)
   ============================================ */

.modal-content {
    border: none;
    border-radius: var(--radius-2xl);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(40px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-header {
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
    padding: 20px 24px;
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 0.5px solid rgba(0, 0, 0, 0.08);
    padding: 16px 24px;
}

.btn-close {
    opacity: 0.4;
    transition: opacity 0.2s;
}

.btn-close:hover {
    opacity: 0.8;
}

/* ============================================
   Credential Tiles (Enhanced Glass)
   ============================================ */

.credential-tile {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    padding: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.credential-tile::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.credential-tile:hover::before {
    opacity: 1;
}

.credential-tile:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   Form Controls (iOS Style)
   ============================================ */

.form-control,
.form-select {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-xs);
    padding: 12px 16px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ios-blue);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
    outline: none;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ios-text-secondary);
    margin-bottom: 8px;
    letter-spacing: -0.1px;
}

/* ============================================
   Scrollbar (iOS Style)
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Utility Classes
   ============================================ */

.glass-blur {
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.shadow-ios {
    box-shadow: var(--shadow-md);
}

.text-ios-secondary {
    color: var(--ios-text-secondary);
}

.text-ios-tertiary {
    color: var(--ios-text-tertiary);
}

.bg-glass {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
}

/* ============================================
   Square Qualification Cards
   ============================================ */

.glass-card.qualification-square {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    h1 { font-size: 28px; }
    h2 { font-size: 24px; }
    h3 { font-size: 20px; }

    .glass-card {
        border-radius: var(--radius-lg);
    }

    .card.tile-card,
    .card.tile {
        border-radius: var(--radius-md);
    }
}
