/* -------------------------------------------------------------
   DESIGN SYSTEM & VARIABLES
   ------------------------------------------------------------- */
:root {
    /* Color Palette - HSL values for color flexibility */
    --hue-primary: 212;   /* Azure Blue */
    --hue-secondary: 275; /* Neon Violet */
    --hue-success: 145;   /* Emerald Green */
    --hue-warning: 14;    /* Vivid Coral */

    /* Typography */
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    /* Layout & Spacing */
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme (Default) */
body.dark-theme {
    --bg-gradient-start: hsl(222, 24%, 7%);
    --bg-gradient-end: hsl(222, 24%, 12%);
    --card-bg: hsla(222, 24%, 15%, 0.6);
    --card-border: hsla(222, 20%, 25%, 0.4);
    --border-color: hsla(222, 20%, 25%, 0.3);
    
    --text-primary: hsl(210, 40%, 98%);
    --text-secondary: hsl(210, 20%, 75%);
    --text-muted: hsl(210, 10%, 55%);
    
    --primary-glow: hsl(var(--hue-primary), 100%, 60%);
    --secondary-glow: hsl(var(--hue-secondary), 90%, 65%);
    --success-glow: hsl(var(--hue-success), 80%, 50%);
    --warning-glow: hsl(var(--hue-warning), 90%, 60%);
    
    --shadow-color: rgba(0, 0, 0, 0.4);
    --glow-opacity: 0.15;
    --console-bg: hsl(222, 24%, 6%);

    /* Table custom properties */
    --table-header-bg: hsla(222, 24%, 10%, 0.4);
    --table-header-color: var(--text-secondary);
    --table-container-bg: hsla(222, 24%, 6%, 0.15);
    --table-row-hover-bg: hsla(212, 100%, 60%, 0.02);
    --table-border: var(--card-border);

    /* User Profile Dropdown custom properties */
    --dropdown-bg: rgba(18, 18, 24, 0.95);
    --dropdown-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.1);
    --dropdown-item-border: rgba(255, 255, 255, 0.05);

    /* Service Status tile properties */
    --service-tile-bg: hsla(222, 24%, 10%, 0.4);
    --service-tile-hover-bg: hsla(222, 24%, 14%, 0.6);
    --service-tile-hover-border: rgba(255, 255, 255, 0.15);
    --version-badge-bg: rgba(255, 255, 255, 0.06);
    --version-badge-border: rgba(255, 255, 255, 0.1);

    /* Floating Bottom Navigation Variables */
    --floating-nav-bg: rgba(10, 10, 10, 0.72);
    --floating-nav-border: rgba(255, 255, 255, 0.08);
    --floating-nav-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
    --floating-nav-item-active-bg: rgba(255, 255, 255, 0.07);
    --floating-nav-scrollbar-thumb: rgba(255, 255, 255, 0.45);
}

/* Light Theme */
body.light-theme {
    --bg-gradient-start: hsl(210, 30%, 93%);
    --bg-gradient-end: hsl(210, 30%, 97%);
    --card-bg: hsla(0, 0%, 100%, 0.7);
    --card-border: hsla(210, 30%, 80%, 0.4);
    --border-color: hsla(210, 30%, 80%, 0.3);
    
    --text-primary: hsl(222, 24%, 12%);
    --text-secondary: hsl(222, 15%, 35%);
    --text-muted: hsl(222, 10%, 55%);
    
    --primary-glow: hsl(var(--hue-primary), 90%, 50%);
    --secondary-glow: hsl(var(--hue-secondary), 80%, 55%);
    --success-glow: hsl(var(--hue-success), 70%, 40%);
    --warning-glow: hsl(var(--hue-warning), 80%, 50%);
    
    --shadow-color: rgba(100, 110, 140, 0.1);
    --glow-opacity: 0.05;
    --console-bg: hsl(210, 30%, 90%);

    /* Table custom properties */
    --table-header-bg: hsla(210, 30%, 85%, 0.75);
    --table-header-color: var(--text-primary);
    --table-container-bg: hsla(210, 30%, 90%, 0.25);
    --table-row-hover-bg: hsla(212, 100%, 60%, 0.04);
    --table-border: hsla(210, 30%, 75%, 0.5);

    /* User Profile Dropdown custom properties */
    --dropdown-bg: rgba(255, 255, 255, 0.95);
    --dropdown-shadow: 0 10px 40px rgba(100, 110, 140, 0.15), 0 0 1px rgba(0, 0, 0, 0.08);
    --dropdown-item-border: rgba(0, 0, 0, 0.05);

    /* Service Status tile properties */
    --service-tile-bg: hsla(210, 30%, 90%, 0.35);
    --service-tile-hover-bg: hsla(210, 30%, 85%, 0.6);
    --service-tile-hover-border: hsla(210, 30%, 75%, 0.5);
    --version-badge-bg: rgba(0, 0, 0, 0.05);
    --version-badge-border: rgba(0, 0, 0, 0.08);

    /* Floating Bottom Navigation Variables */
    --floating-nav-bg: rgba(255, 255, 255, 0.75);
    --floating-nav-border: rgba(0, 0, 0, 0.08);
    --floating-nav-shadow: 0 16px 40px rgba(100, 110, 140, 0.15);
    --floating-nav-item-active-bg: rgba(0, 0, 0, 0.05);
    --floating-nav-scrollbar-thumb: rgba(0, 0, 0, 0.25);
}

html {
    overflow-y: scroll;
    background-color: var(--bg-gradient-end);
}

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

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background var(--transition-smooth), color var(--transition-smooth);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-gradient-start);
}
::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--bg-gradient-start);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-glow);
}

/* -------------------------------------------------------------
   SCROLL-DRIVEN PROGRESS BAR
   ------------------------------------------------------------- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(to right, var(--primary-glow), var(--secondary-glow));
    width: 0%;
    z-index: 1000;
}

/* Progressive enhancement with CSS-native scroll tracking */
@supports (animation-timeline: scroll()) {
    #scroll-progress {
        width: auto;
        right: 0;
        transform-origin: 0% 50%;
        animation: progress-grow auto linear;
        animation-timeline: scroll(root);
    }
    
    @keyframes progress-grow {
        from { transform: scaleX(0); }
        to { transform: scaleX(1); }
    }
}

/* -------------------------------------------------------------
   HEADER & NAVIGATION
   ------------------------------------------------------------- */
.app-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition-smooth);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: var(--transition-smooth);
    min-height: 88px;
    box-sizing: border-box;
}

@media (min-width: 769px) {
    .header-container {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    }
    .brand {
        justify-self: start;
    }
    .nav-menu {
        justify-self: center;
    }
    .header-actions {
        justify-self: end;
    }
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition-smooth);
}

.brand-link:hover {
    opacity: 0.9;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .header-container {
        display: grid;
        grid-template-areas: 
            "brand actions"
            "nav nav";
        grid-template-columns: 1fr auto;
        row-gap: 0.75rem;
        column-gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
    
    .brand {
        grid-area: brand;
    }
    
    .header-actions {
        grid-area: actions;
        gap: 0.75rem;
    }
    
    .nav-menu {
        grid-area: nav;
        justify-content: center;
        width: 100%;
        border-top: 1px solid var(--card-border);
        padding-top: 0.75rem;
        gap: 1.5rem;
    }

    .brand-link h1 {
        font-size: 1.15rem;
    }
    
    .brand-link h1 .badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
        margin-left: 0.4rem;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0.6rem 0.75rem;
        row-gap: 0.6rem;
    }
    .nav-menu {
        gap: 1rem;
    }
    .nav-link {
        font-size: 0.85rem;
        padding: 0.2rem 0.4rem;
    }
    #logout-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
        gap: 0.25rem;
    }
    #logout-btn svg {
        width: 12px;
        height: 12px;
    }
}

.nav-link {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-glow);
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 8px;
    right: 8px;
    height: 2px;
    background: var(--primary-glow);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.nav-link:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-link.active::before {
    display: none;
}

.nav-link.active {
    color: var(--primary-glow);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 8px;
    right: 8px;
    height: 2px;
    background: var(--primary-glow);
    border-radius: 2px;
}


.logo-orb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
    border-radius: 50%;
    box-shadow: 0 0 12px var(--primary-glow);
}

.brand h1 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    font-size: 0.65rem;
    font-family: var(--font-primary);
    background: var(--border-color);
    color: var(--text-secondary);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    text-transform: uppercase;
    font-weight: 600;
    border: 1px solid var(--card-border);
}

.system-time {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    background: var(--console-bg);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--card-border);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.network-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--success-glow);
    border-radius: 50%;
    position: relative;
}

.pulse-indicator::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid var(--success-glow);
    border-radius: 50%;
    animation: pulse 1.8s infinite ease-out;
}

@keyframes pulse {
    0% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.status-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* -------------------------------------------------------------
   DASHBOARD GRID ELEMENTS
   ------------------------------------------------------------- */
.dashboard-grid {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem 4rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    align-items: start;
    align-content: start;
    flex-grow: 1;
    width: 100%;
}

@media (max-width: 991px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        padding: 1.5rem 1rem;
        gap: 1.5rem;
    }
}

/* Card Sizes styling */
.span-medium {
    grid-column: span 1;
}

.span-large {
    grid-column: 1 / -1;
}

@media (min-width: 900px) {
    .span-medium {
        grid-column: span 2;
    }
}

/* Glassmorphism Card Style */
.widget-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    box-shadow: 0 8px 32px var(--shadow-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.widget-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--shadow-color);
    border-color: hsla(var(--hue-primary), 100%, 65%, 0.2);
}

/* -------------------------------------------------------------
   WIDGETS SPECIFIC STYLES
   ------------------------------------------------------------- */

/* Hero status widget */
.hero-widget {
    background: linear-gradient(135deg, var(--card-bg), hsla(var(--hue-primary), 90%, 15%, 0.15));
}

.hero-bg-glow {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, hsla(var(--hue-primary), 100%, 60%, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Gauge metrics loops */
.metrics-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 2rem;
}

.metric-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__bg {
    stroke-linecap: round;
}

.progress-ring__circle {
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease-in-out;
}

.metric-value {
    position: absolute;
    top: 40px;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.metric-label {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Header style within widgets */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.header-title h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
}

.header-title svg {
    color: var(--primary-glow);
}

/* Badge helpers */
.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.status-badge.success {
    background: hsla(var(--hue-success), 80%, 40%, 0.15);
    color: var(--success-glow);
    border: 1px solid hsla(var(--hue-success), 80%, 40%, 0.3);
}

/* Info lines styling */
.dns-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.info-row .label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.info-row .value {
    font-size: 0.9rem;
    font-weight: 500;
}

.code-text {
    font-family: monospace;
    font-size: 0.85rem !important;
    background: var(--console-bg);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

/* Console logs widget styling */
.ddns-console {
    color-scheme: dark;
    --console-bg: hsl(222, 24%, 6%);
    --card-border: hsla(222, 20%, 25%, 0.4);
    --text-primary: hsl(210, 40%, 98%);
    --text-secondary: hsl(210, 20%, 75%);
    --text-muted: hsl(210, 10%, 55%);

    background: var(--console-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 100px;
}

.console-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.4rem;
    margin-bottom: 0.5rem;
}

.console-body {
    font-family: monospace;
    font-size: 0.75rem;
    overflow-y: auto;
    max-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

#rsp-console,
#audit-console {
    color-scheme: dark !important;
    --console-bg: hsl(222, 24%, 6%);
    --card-border: hsla(222, 20%, 25%, 0.4);
    --text-primary: hsl(210, 40%, 98%);
    --text-secondary: hsl(210, 20%, 75%);
    --text-muted: hsl(210, 10%, 55%);

    background: var(--console-bg) !important;
    border-color: var(--card-border) !important;
    color: var(--text-secondary) !important;
}

.log-line.info { color: var(--text-secondary); }
.log-line.success { color: var(--success-glow); }
.log-line.error { color: var(--warning-glow); }

/* Hosted services lists */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-grow: 1;
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.service-item:hover {
    background: hsla(var(--hue-primary), 100%, 60%, 0.05);
    border-color: hsla(var(--hue-primary), 100%, 60%, 0.2);
}

.service-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background: var(--success-glow);
    box-shadow: 0 0 8px var(--success-glow);
}

.service-meta h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.service-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.service-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Smart controls switches styling */
.controls-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.control-row span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Storage Disk usages styles */
.storage-details {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.storage-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
}

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

.storage-values {
    color: var(--text-muted);
}

.progress-bar-container {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease-out;
}

/* -------------------------------------------------------------
   BUTTON & SWITCH COMPONENT DESIGNS
   ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
    color: white;
    box-shadow: 0 4px 14px rgba(var(--hue-primary), 100%, 60%, 0.3);
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 18px rgba(var(--hue-primary), 100%, 60%, 0.45);
}

.btn-secondary {
    background: var(--border-color);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--card-border);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.btn-icon:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

#theme-toggle {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
}

#theme-toggle:active {
    transform: scale(0.9) rotate(-15deg);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-glow);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
}

.btn-text:hover {
    text-decoration: underline;
}

/* Sun/Moon icons transitions */
body.dark-theme .sun-icon,
body.light-theme .moon-icon {
    display: none;
}

body.light-theme .sun-icon,
body.dark-theme .moon-icon {
    display: block;
    width: 20px;
    height: 20px;
}

/* Switch (Checkbox wrapper) styling */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
    border: 1px solid var(--card-border);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--success-glow);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* -------------------------------------------------------------
   ACCESSIBLE DIALOG MODALS DESIGN
   ------------------------------------------------------------- */
.modal-dialog {
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    background: var(--bg-gradient-end);
    color: var(--text-primary);
    padding: 1.5rem;
    margin: auto;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    transition: var(--transition-smooth);
    opacity: 0;
    transform: translateY(20px);
}

/* Open transitions via @starting-style */
.modal-dialog[open] {
    opacity: 1;
    transform: translateY(0);
}

@starting-style {
    .modal-dialog[open] {
        opacity: 0;
        transform: translateY(20px);
    }
}

.modal-dialog::backdrop {
    background: rgba(10, 15, 30, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: var(--transition-smooth);
}

.modal-dialog[open]::backdrop {
    opacity: 1;
}

@starting-style {
    .modal-dialog[open]::backdrop {
        opacity: 0;
    }
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.dialog-header h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
}

.dialog-body p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.stats-table {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: var(--console-bg);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
    border: 1px solid var(--card-border);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.stats-row span {
    color: var(--text-muted);
}

.stats-row .value {
    font-weight: 600;
    color: var(--text-secondary);
}

.success-text { color: var(--success-glow) !important; }
.warning-text { color: var(--warning-glow) !important; }

/* Form Groups (General) */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Dialog forms */
.dialog-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.dialog-form label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.dialog-form select {
    background: var(--console-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-primary);
    outline: none;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

/* -------------------------------------------------------------
   FOOTER STYLING
   ------------------------------------------------------------- */
.app-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    background: var(--console-bg);
    transition: var(--transition-smooth);
}

.app-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* -------------------------------------------------------------
   ACCESSIBILITY & KEYBOARD FOCUS STYLES
   ------------------------------------------------------------- */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--primary-glow);
    outline-offset: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary-glow);
    outline-offset: 3px;
}

/* -------------------------------------------------------------
   PREFERS REDUCED MOTION SUPPORT
   ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-delay: 0s !important;
        animation-duration: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0s !important;
        scroll-behavior: auto !important;
    }
}

/* -------------------------------------------------------------
   PROFILE MANAGEMENT DASHBOARD STYLES
   ------------------------------------------------------------- */
.dropzone-area {
    border: 2px dashed var(--card-border);
    border-radius: var(--border-radius-sm);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    background: hsla(222, 24%, 6%, 0.2);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.dropzone-area:hover,
.dropzone-area.dragover {
    border-color: var(--primary-glow);
    background: hsla(212, 100%, 60%, 0.05);
    box-shadow: 0 0 15px hsla(var(--hue-primary), 100%, 60%, 0.1);
}

.dropzone-icon {
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.dropzone-area:hover .dropzone-icon {
    color: var(--primary-glow);
    transform: translateY(-2px);
}

.dropzone-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.dropzone-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    background: var(--console-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    padding: 0.6rem 0.8rem;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-glow);
    box-shadow: 0 0 10px hsla(var(--hue-primary), 100%, 60%, 0.1);
}

/* Custom styling for file inputs to match the theme */
input[type="file"].form-input {
    padding: 0.35rem 0.5rem;
    cursor: pointer;
}

input[type="file"].form-input::file-selector-button {
    background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    margin-right: 0.75rem;
    box-shadow: 0 2px 8px rgba(var(--hue-primary), 100%, 60%, 0.2);
}

input[type="file"].form-input::file-selector-button:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(var(--hue-primary), 100%, 60%, 0.35);
}


/* Filters Bar */
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box svg {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 0.6rem 2.5rem 0.6rem 2.4rem;
    background: var(--console-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-glow);
    box-shadow: 0 0 10px hsla(var(--hue-primary), 100%, 60%, 0.15);
}

.search-shortcut {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-primary), system-ui;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--card-border);
    border: 1px solid var(--table-border);
    padding: 2px 5px;
    border-radius: 4px;
    pointer-events: none;
    transition: var(--transition-smooth);
    opacity: 0.75;
}

.search-box input:focus ~ .search-shortcut {
    opacity: 0;
    transform: translateY(-50%) scale(0.8);
}

.filter-select {
    padding: 0.6rem 1.5rem 0.6rem 0.8rem;
    background: var(--console-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238892b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 4 6 7 9 4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-glow);
}

/* Responsive Table Columns */
@media (max-width: 768px) {
    .col-mobile-hide {
        display: none !important;
    }
}

/* Table Design */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--table-border);
    border-radius: var(--border-radius-sm);
    background: var(--table-container-bg);
}

.profiles-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.profiles-table th,
.profiles-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--table-border);
}

.profiles-table th {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--table-header-color);
    background: var(--table-header-bg);
    letter-spacing: 0.5px;
}

.profiles-table tbody tr {
    transition: var(--transition-smooth);
}

.profiles-table tbody tr:hover {
    background: var(--table-row-hover-bg);
}

.profiles-table td {
    color: var(--text-secondary);
}

.code-text-mono {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

/* Status Badges */
.status-pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50px;
    text-align: center;
    border: 1px solid transparent;
}

.status-pill.available {
    background: hsla(var(--hue-primary), 100%, 60%, 0.1);
    color: var(--primary-glow);
    border-color: hsla(var(--hue-primary), 100%, 60%, 0.2);
}

.status-pill.ordered {
    background: hsla(var(--hue-secondary), 90%, 65%, 0.1);
    color: var(--secondary-glow);
    border-color: hsla(var(--hue-secondary), 90%, 65%, 0.2);
}

.status-pill.released {
    background: hsla(38, 95%, 50%, 0.1);
    color: hsl(38, 95%, 50%);
    border-color: hsla(38, 95%, 50%, 0.2);
}

.status-pill.downloaded {
    background: hsla(var(--hue-success), 80%, 50%, 0.1);
    color: var(--success-glow);
    border-color: hsla(var(--hue-success), 80%, 50%, 0.2);
}

.status-pill.enabled {
    background: hsla(270, 90%, 65%, 0.12);
    color: hsl(270, 90%, 70%);
    border-color: hsla(270, 90%, 65%, 0.25);
}

.table-loading {
    text-align: center;
    padding: 2.5rem !important;
    color: var(--text-muted);
}

.table-empty {
    text-align: center;
    padding: 2.5rem !important;
    color: var(--text-muted);
}

.btn-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-action-trigger {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    cursor: pointer;
}

.btn-delete {
    background: hsla(var(--hue-warning), 90%, 60%, 0.08);
    color: var(--warning-glow);
    border: 1px solid hsla(var(--hue-warning), 90%, 60%, 0.15);
    transition: var(--transition-smooth);
}

.btn-delete:hover:not(:disabled) {
    background: var(--warning-glow);
    color: white;
    box-shadow: 0 0 10px hsla(var(--hue-warning), 90%, 60%, 0.25);
}

.btn-delete:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-action-trigger.btn-primary-action {
    background: hsla(var(--hue-primary), 100%, 60%, 0.08);
    color: var(--primary-glow);
    border: 1px solid hsla(var(--hue-primary), 100%, 60%, 0.15);
    transition: var(--transition-smooth);
}

.btn-action-trigger.btn-primary-action:hover:not(:disabled) {
    background: var(--primary-glow);
    color: white;
    box-shadow: 0 0 10px hsla(var(--hue-primary), 100%, 60%, 0.25);
}

.btn-action-trigger.btn-secondary-action {
    background: hsla(var(--hue-secondary), 90%, 65%, 0.08);
    color: var(--secondary-glow);
    border: 1px solid hsla(var(--hue-secondary), 90%, 65%, 0.15);
    transition: var(--transition-smooth);
}

.btn-action-trigger.btn-secondary-action:hover:not(:disabled) {
    background: var(--secondary-glow);
    color: white;
    box-shadow: 0 0 10px hsla(var(--hue-secondary), 90%, 65%, 0.25);
}

.btn-action-trigger.btn-success-action {
    background: hsla(var(--hue-success), 80%, 50%, 0.08);
    color: var(--success-glow);
    border: 1px solid hsla(var(--hue-success), 80%, 50%, 0.15);
    transition: var(--transition-smooth);
}

.btn-action-trigger.btn-success-action:hover:not(:disabled) {
    background: var(--success-glow);
    color: white;
    box-shadow: 0 0 10px hsla(var(--hue-success), 80%, 50%, 0.25);
}

.profiles-table tbody tr.selected-row {
    background: hsla(var(--hue-primary), 100%, 60%, 0.08) !important;
    border-left: 3px solid var(--primary-glow);
}

/* -------------------------------------------------------------
   LPA SIMULATOR FLOATING WINDOW
   ------------------------------------------------------------- */
#lpa-sim-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    font-family: var(--font-primary);
}

/* Minimized Pill Button */
.lpa-sim-pill-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, hsla(var(--hue-primary), 100%, 60%, 0.9), hsla(var(--hue-secondary), 90%, 65%, 0.9));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 18px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 15px hsla(var(--hue-primary), 100%, 60%, 0.3);
    transition: var(--transition-smooth);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lpa-sim-pill-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 25px hsla(var(--hue-primary), 100%, 60%, 0.5);
}

.lpa-sim-pill-btn:active {
    transform: translateY(-1px);
}

.lpa-sim-icon-pulse {
    animation: lpa-pulse 2s infinite;
}

@keyframes lpa-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Expanded Floating Window */
.lpa-sim-window {
    width: 380px;
    height: 500px;
    max-width: calc(100vw - 48px);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    box-shadow: 0 12px 40px var(--shadow-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: lpa-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition: opacity 0.3s, transform 0.3s;
}

/* -------------------------------------------------------------
   IPHONE 15 PRO DEVICE FRAMING
   ------------------------------------------------------------- */
.lpa-sim-window.iphone-chassis {
    width: 380px;
    height: 760px;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 48px);
    border-radius: 48px;
    border: 11px solid #1c1c1e; /* Matte black bezel */
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(0, 0, 0, 0.8), 0 0 0 2px #48484a; /* Titanium outer frame */
    background: #000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: lpa-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition: opacity 0.3s, transform 0.3s, width 0.3s, height 0.3s;
}

.iphone-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--card-bg);
    border-radius: 36px;
    padding-top: 40px; /* Offset for status bar & dynamic island */
    padding-bottom: 20px; /* Offset for home indicator */
    position: relative;
}

.iphone-status-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-primary);
    z-index: 1010;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.iphone-island {
    width: 100px;
    height: 25px;
    background: #000;
    border-radius: 20px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 8px;
    z-index: 1020;
    box-shadow: 0 1px 3px rgba(255, 255, 255, 0.05);
}

.iphone-status-icons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.iphone-signal-icon {
    width: 12px;
    height: 12px;
    opacity: 0.95;
    color: var(--text-primary);
}

.iphone-battery {
    width: 18px;
    height: 9px;
    border: 1px solid var(--text-primary);
    border-radius: 2.5px;
    position: relative;
    padding: 1px;
}

.iphone-battery::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: var(--text-primary);
    border-radius: 1.5px;
}

.iphone-home-indicator {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
    height: 5px;
    background: var(--text-muted);
    border-radius: 10px;
    z-index: 1010;
    pointer-events: none;
    opacity: 0.6;
}

/* Responsive scaling rules for small viewports */
@media (max-height: 820px) {
    .lpa-sim-window.iphone-chassis {
        height: 640px;
        border-width: 9px;
        border-radius: 38px;
    }
    .iphone-screen {
        padding-top: 36px;
        padding-bottom: 16px;
        border-radius: 28px;
    }
}

@media (max-width: 420px) {
    .lpa-sim-window.iphone-chassis {
        width: 320px;
        height: 640px;
        border-width: 9px;
        border-radius: 38px;
    }
    .iphone-screen {
        padding-top: 36px;
        padding-bottom: 16px;
        border-radius: 28px;
    }
    .iphone-status-bar {
        padding: 0 20px;
    }
}

/* Resize handle in the bottom-right corner of the chassis */
.iphone-resize-handle {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    cursor: nwse-resize;
    z-index: 1050;
}

.iphone-resize-handle::after {
    content: '';
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 10px 10px;
    border-color: transparent transparent var(--text-muted) transparent;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.iphone-resize-handle:hover::after {
    opacity: 0.9;
    border-color: transparent transparent var(--primary-glow) transparent;
}

/* Network Type Badges */
.badge-4g {
    background: rgba(0, 168, 204, 0.12);
    color: #00cdfc;
    border: 1px solid rgba(0, 168, 204, 0.25);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-block;
    letter-spacing: 0.5px;
    font-family: var(--font-primary);
}

.badge-5g {
    background: rgba(184, 109, 255, 0.12);
    color: #c58dff;
    border: 1px solid rgba(184, 109, 255, 0.25);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-block;
    letter-spacing: 0.5px;
    font-family: var(--font-primary);
    box-shadow: 0 0 8px rgba(184, 109, 255, 0.1);
}
@keyframes lpa-slide-in {
    from { transform: translateY(20px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.lpa-sim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--card-border);
}

.lpa-sim-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lpa-sim-title h4 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.lpa-sim-header-icon {
    color: var(--secondary-glow);
}

.lpa-status-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.lpa-status-badge.idle {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.lpa-status-badge.downloading {
    background: hsla(var(--hue-primary), 100%, 60%, 0.15);
    color: var(--primary-glow);
    border-color: hsla(var(--hue-primary), 100%, 60%, 0.25);
    animation: lpa-badge-pulse 1.5s infinite alternate;
}

@keyframes lpa-badge-pulse {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

.lpa-status-badge.success {
    background: hsla(var(--hue-success), 80%, 50%, 0.15);
    color: var(--success-glow);
    border-color: hsla(var(--hue-success), 80%, 50%, 0.25);
}

.lpa-status-badge.failed {
    background: hsla(var(--hue-warning), 90%, 60%, 0.15);
    color: var(--warning-glow);
    border-color: hsla(var(--hue-warning), 90%, 60%, 0.25);
}

.btn-icon-sm {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-icon-sm:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.lpa-sim-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
    overflow-y: auto;
}

.lpa-sim-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.form-group-sm {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group-sm label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lpa-sim-textarea {
    width: 100%;
    height: 52px;
    padding: 8px 10px;
    background: var(--console-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.75rem;
    resize: none;
    line-height: 1.3;
}

.lpa-sim-textarea:focus {
    outline: none;
    border-color: var(--primary-glow);
}

.btn-sim-download {
    width: 100%;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 4px;
    background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-sim-download:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 10px hsla(var(--hue-primary), 100%, 60%, 0.3);
}

.btn-sim-download:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--card-border);
}

.lpa-sim-console-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
    flex: 1 1 auto;
}

.lpa-sim-console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-text-sm {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-text-sm:hover {
    color: var(--primary-glow);
}

.lpa-sim-logs-area {
    color-scheme: dark;
    --console-bg: hsl(222, 24%, 6%);
    --card-border: hsla(222, 20%, 25%, 0.4);
    --text-primary: hsl(210, 40%, 98%);
    --text-secondary: hsl(210, 20%, 75%);
    --text-muted: hsl(210, 10%, 55%);

    background: var(--console-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    padding: 10px;
    flex: 1 1 auto;
    min-height: 120px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lpa-sim-logs-area .log-entry {
    word-break: break-all;
}

.lpa-sim-logs-area .log-entry.info {
    color: var(--text-muted);
}

.lpa-sim-logs-area .log-entry.process {
    color: var(--primary-glow);
}

.lpa-sim-logs-area .log-entry.success {
    color: var(--success-glow);
}

.lpa-sim-logs-area .log-entry.error {
    color: var(--warning-glow);
}

/* Tabs Navigation */
.lpa-sim-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--card-border);
}

.lpa-tab-btn {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: center;
}

.lpa-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.lpa-tab-btn.active {
    color: var(--primary-glow);
    border-bottom-color: var(--primary-glow);
    background: rgba(255, 255, 255, 0.04);
}

/* Tab Panels */
.lpa-tab-pane {
    display: none;
}

.lpa-tab-pane.active {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
}

/* Local Profiles List */
.lpa-device-profiles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    overflow-y: auto;
    padding-right: 4px;
}

.lpa-profile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
}

.lpa-profile-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
}

.lpa-profile-item.enabled {
    border-color: hsla(var(--hue-success), 80%, 50%, 0.3);
    background: hsla(var(--hue-success), 80%, 50%, 0.03);
}

.lpa-profile-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0; /* allows text truncation */
}

.lpa-profile-nickname {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lpa-profile-iccid-smdp {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lpa-profile-status-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lpa-empty-state {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border: 1px dashed var(--card-border);
    border-radius: var(--border-radius-sm);
}

/* Mini-Switch */
.lpa-switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
}

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

.lpa-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 20px;
    border: 1px solid var(--card-border);
}

.lpa-slider:before {
    position: absolute;
    content: "";
    height: 10px;
    width: 10px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 50%;
}

.lpa-switch input:checked + .lpa-slider {
    background-color: hsla(var(--hue-success), 80%, 50%, 0.2);
    border-color: var(--success-glow);
}

.lpa-switch input:checked + .lpa-slider:before {
    transform: translateX(16px);
    background-color: var(--success-glow);
}

/* Action Buttons */
.btn-profile-action {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-profile-action:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-profile-action.edit:hover {
    color: var(--primary-glow);
}

.btn-profile-action.delete:hover {
    color: var(--warning-glow);
}

/* -------------------------------------------------------------
   CUSTOM TOAST NOTIFICATIONS
   ------------------------------------------------------------- */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 30px var(--shadow-color);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 300px;
    max-width: 450px;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s ease;
    animation: toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast.toast-show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast.toast-hide {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
}

/* Toast types with premium glowing borders */
.toast-success {
    border-left: 4px solid var(--success-glow);
}

.toast-error {
    border-left: 4px solid var(--warning-glow);
}

.toast-warning {
    border-left: 4px solid var(--warning-glow);
}

.toast-info {
    border-left: 4px solid var(--primary-glow);
}

/* Toast Icons */
.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    color: var(--success-glow);
}

.toast-error .toast-icon,
.toast-warning .toast-icon {
    color: var(--warning-glow);
}

.toast-info .toast-icon {
    color: var(--primary-glow);
}

.toast-message {
    flex-grow: 1;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.toast-close:hover {
    color: var(--text-primary);
    background: var(--card-border);
}

@keyframes toast-in {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}



/* -------------------------------------------------------------
   USER PROFILE DROPDOWN COMPONENT
   ------------------------------------------------------------- */
.user-profile-section {
    position: relative;
    font-family: var(--font-primary), system-ui, sans-serif;
}

.user-profile-trigger {
    background: transparent;
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg, 30px);
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--text-primary);
}

.user-profile-trigger:hover {
    background: var(--card-border);
    border-color: rgba(var(--hue-primary), 100%, 60%, 0.3);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(var(--hue-primary), 100%, 60%, 0.2);
}

.user-display-name {
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.user-profile-trigger .chevron-icon {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
    color: var(--text-muted);
}

.user-profile-section.active .user-profile-trigger .chevron-icon {
    transform: rotate(180deg);
}

.user-profile-dropdown {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    width: 260px;
    background: var(--dropdown-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md, 12px);
    box-shadow: var(--dropdown-shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1.25rem;
    display: none;
    flex-direction: column;
    z-index: 150;
    transform: translateY(10px);
    opacity: 0;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-profile-section.active .user-profile-dropdown {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

.user-dropdown-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0.25rem;
}

.user-signed-in-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.user-identity {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.user-display-name-header {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.user-card-username {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.user-email-header {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dropdown-footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.dropdown-footer-actions .badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm, 4px);
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
}

.btn-logout {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    background: var(--border-color);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm, 4px);
    transition: var(--transition-smooth);
}

.btn-logout:hover {
    background: rgba(239, 83, 80, 0.15) !important;
    color: #ef5350 !important;
    border-color: rgba(239, 83, 80, 0.3) !important;
    box-shadow: 0 4px 12px rgba(239, 83, 80, 0.1);
}

.btn-logout svg {
    transition: transform 0.2s;
    margin-right: 0.25rem;
}

.btn-logout:hover svg {
    transform: translateX(2px);
}

/* Mobile optimizations */
@media (max-width: 576px) {
    .user-profile-trigger {
        padding: 0.25rem;
        border-radius: 50%;
        border: none;
    }
    .user-display-name,
    .user-profile-trigger .chevron-icon {
        display: none;
    }
    .user-profile-dropdown {
        width: 240px;
        top: calc(100% + 0.75rem);
    }
}

/* Scrolled Header Style */
.app-header.header-scrolled {
    background: var(--dropdown-bg) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08) !important;
    border-bottom-color: var(--card-border) !important;
}
.app-header.header-scrolled .header-container {
    padding-top: 0.65rem !important;
    padding-bottom: 0.65rem !important;
    min-height: 74px;
}

/* -------------------------------------------------------------
   DEVELOPER TOOLS DASHBOARD STYLING
   ------------------------------------------------------------- */
.tools-dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    max-width: 1400px;
    width: 100%;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
    flex: 1;
    align-items: start;
    min-height: calc(100svh - 140px);
}

.tools-sidebar {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 90px;
    border-radius: var(--border-radius-md);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.sidebar-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.75rem;
}

.tools-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.tools-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.tools-menu-item svg {
    stroke: var(--text-muted);
    transition: var(--transition-smooth);
}

.tools-menu-item:hover {
    background: hsla(var(--hue-primary), 100%, 60%, 0.05);
    color: var(--text-primary);
    border-color: hsla(var(--hue-primary), 100%, 60%, 0.1);
}

.tools-menu-item:hover svg {
    stroke: var(--text-primary);
}

.tools-menu-item.active {
    background: linear-gradient(135deg, hsla(var(--hue-primary), 100%, 60%, 0.15), hsla(var(--hue-secondary), 90%, 65%, 0.05));
    color: var(--primary-glow);
    border-color: hsla(var(--hue-primary), 100%, 60%, 0.25);
    font-weight: 600;
}

.tools-menu-item.active svg {
    stroke: var(--primary-glow);
}

.tools-content {
    padding: 2rem;
    min-height: 580px;
    display: flex;
    flex-direction: column;
    border-radius: var(--border-radius-md);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.tool-panel {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
    animation: fadeIn 0.3s ease;
}

.tool-panel.active {
    display: flex;
}

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

.panel-header {
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
}

.panel-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.panel-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.tool-io-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    flex: 1;
}

.input-pane, .output-pane {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.action-buttons-group {
    display: flex;
    gap: 0.4rem;
}

.btn-small {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

.code-editor {
    width: 100%;
    height: 340px;
    background: var(--console-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.85rem;
    padding: 1rem;
    resize: none;
    line-height: 1.5;
    outline: none;
    transition: var(--transition-smooth);
}

.code-editor:focus {
    border-color: var(--primary-glow);
    box-shadow: 0 0 12px hsla(var(--hue-primary), 100%, 60%, 0.1);
}

.code-viewer-container {
    background: var(--console-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    height: 340px;
    overflow: auto;
    padding: 1rem;
    margin: 0;
}

.code-viewer {
    font-family: monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    display: block;
}

.validation-msg {
    padding: 0.55rem 0.85rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
}

.validation-msg.error {
    background: hsla(var(--hue-warning), 90%, 60%, 0.08);
    color: var(--warning-glow);
    border: 1px solid hsla(var(--hue-warning), 90%, 60%, 0.25);
}

.validation-msg.success {
    background: hsla(var(--hue-success), 80%, 50%, 0.08);
    color: var(--success-glow);
    border: 1px solid hsla(var(--hue-success), 80%, 50%, 0.25);
}

.form-row-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

.form-row-group .form-group {
    flex: 1;
    min-width: 180px;
}

.crypto-config-box {
    margin-top: 0.5rem;
}

.regex-match-hl {
    background: hsla(var(--hue-primary), 100%, 60%, 0.22);
    border-bottom: 2px solid var(--primary-glow);
    border-radius: 2px;
}

.regex-group-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    border-radius: 4px;
    background: hsla(var(--hue-secondary), 90%, 65%, 0.12);
    border: 1px solid hsla(var(--hue-secondary), 90%, 65%, 0.25);
    color: var(--secondary-glow);
    margin-right: 0.25rem;
    font-weight: 600;
}

/* responsive media overrides */
@media (max-width: 992px) {
    .tools-dashboard-grid {
        grid-template-columns: 1fr;
        margin: 1.5rem auto;
    }
    .tools-sidebar {
        position: static;
    }
    .tools-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        gap: 0.5rem;
    }
    .tools-menu-item {
        white-space: nowrap;
        padding: 0.6rem 0.85rem;
    }
}

@media (max-width: 768px) {
    .tool-io-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .code-editor, .code-viewer-container {
        height: 260px;
    }
    .tools-content {
        padding: 1.25rem;
    }

    .tools-dashboard-grid {
        padding-bottom: 6.5rem !important;
    }

    .tools-sidebar {
        position: fixed !important;
        bottom: 1.25rem !important;
        top: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 92% !important;
        max-width: 480px !important;
        z-index: 9999 !important;
        flex-direction: row !important;
        background: var(--floating-nav-bg) !important;
        border: 1px solid var(--floating-nav-border) !important;
        padding: 0.45rem 0.4rem 0.5rem 0.4rem !important;
        border-radius: 30px !important;
        box-shadow: var(--floating-nav-shadow) !important;
        backdrop-filter: blur(28px) !important;
        -webkit-backdrop-filter: blur(28px) !important;
        overflow: visible !important;
    }

    .tools-sidebar::-webkit-scrollbar {
        display: none !important;
    }

    .tools-sidebar .sidebar-header {
        display: none !important;
    }

    .tools-menu {
        display: flex !important;
        flex-direction: row !important;
        gap: 0.25rem !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 0 6px 0 !important;
        overflow-x: auto !important;
        scrollbar-width: thin !important;
        scrollbar-color: var(--floating-nav-scrollbar-thumb) transparent !important;
    }

    .tools-menu::-webkit-scrollbar {
        display: block !important;
        height: 5px !important;
    }

    .tools-menu::-webkit-scrollbar-track {
        background: transparent !important;
        margin: 0 1.5rem !important;
    }

    .tools-menu::-webkit-scrollbar-thumb {
        background: var(--floating-nav-scrollbar-thumb) !important;
        border-radius: 10px !important;
    }

    .tools-menu::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted) !important;
    }

    .tools-menu-item {
        flex-shrink: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.15rem !important;
        padding: 0.35rem 0.6rem !important;
        font-size: 0.65rem !important;
        font-weight: 500 !important;
        border-radius: 20px !important;
        color: var(--text-muted) !important;
        background: none !important;
        border: none !important;
        text-align: center !important;
        transition: all 0.2s ease !important;
        min-width: 65px !important;
    }

    .tools-menu-item:hover {
        background: none !important;
        color: var(--text-primary) !important;
    }

    .tools-menu-item svg {
        width: 19px !important;
        height: 19px !important;
        margin: 0 !important;
    }

    .tools-menu-item.active {
        background: var(--floating-nav-item-active-bg) !important;
        color: var(--primary-glow) !important;
        border: none !important;
        border-radius: 18px !important;
    }

    .tools-menu-item.active svg {
        stroke: var(--primary-glow) !important;
    }
}

.jwt-output-container {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    flex: 1;
}

@media (max-width: 576px) {
    .jwt-output-container {
        flex-direction: column;
    }
}


/* -------------------------------------------------------------
   PORTFOLIO STYLING - hutta.in
   Inherits design tokens and base styles from index.css
   ------------------------------------------------------------- */

/* Hero Section */
.portfolio-hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 6rem 2rem 4rem;
    overflow: hidden;
}

/* ── Profile Photo ─────────────────────────────────────────────────────────── */
.profile-photo-wrap {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 0 auto;
}

.profile-photo {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    display: block;
    position: relative;
    z-index: 2;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.profile-photo:hover {
    transform: scale(1.04);
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}

/* spinning dashed ring */
.profile-photo-ring {
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 2px dashed var(--card-border);
    animation: rotate-dashed 25s linear infinite;
    pointer-events: none;
    z-index: 1;
}

/* soft glow behind photo */
.profile-photo-glow {
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, hsla(var(--hue-primary), 100%, 60%, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* caption below photo */
.whoami-caption {
    margin-top: 1.2rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.whoami-caption-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.whoami-caption p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    font-style: italic;
}

/* ── Secondary CTA button ───────────────────────────────────────────────────── */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.55rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1.5px solid var(--card-border);
    color: var(--text-primary);
    background: transparent;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-secondary:hover {
    border-color: var(--primary-glow);
    background: hsla(var(--hue-primary), 100%, 60%, 0.08);
    color: var(--primary-glow);
}

/* ── Hero actions row spacing ───────────────────────────────────────────────── */
.hero-actions-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* ── Mobile: left-align bio text ────────────────────────────────────────────── */
@media (max-width: 640px) {
    .hero-desc { text-align: left; }
    .hero-actions-row { justify-content: center; }
}

/* ── Scroll-driven fade-up entrance animations ─────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
        .scroll-animate {
            animation: fade-up-section linear both;
            animation-timeline: view();
            animation-range: entry 5% entry 35%;
        }
    }
}

@keyframes fade-up-section {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}


.hero-glow-1 {
    position: absolute;
    top: 20%;
    left: 10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, hsla(var(--hue-primary), 100%, 60%, 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.hero-glow-2 {
    position: absolute;
    bottom: 10%;
    right: 5%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, hsla(var(--hue-secondary), 90%, 65%, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.hero-container-inner {
    max-width: 1000px;
    width: 100%;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 900px) {
    .hero-container-inner {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
}

.profile-showcase {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.tech-orb-avatar {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--card-bg), var(--bg-gradient-end));
    border: 2px solid var(--card-border);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 40px var(--shadow-color);
    transition: var(--transition-smooth);
}

.tech-orb-avatar:hover {
    transform: scale(1.03) rotate(2deg);
    border-color: var(--primary-glow);
    box-shadow: 0 20px 50px rgba(var(--hue-primary), 100%, 60%, 0.15);
}

.tech-orb-avatar::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    border: 2px dashed var(--card-border);
    animation: rotate-dashed 25s linear infinite;
    pointer-events: none;
}

.tech-orb-avatar::after {
    content: '';
    position: absolute;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, hsla(var(--hue-primary), 100%, 60%, 0.08) 0%, transparent 60%);
    z-index: -1;
}

@keyframes rotate-dashed {
    100% { transform: rotate(360deg); }
}

.avatar-icon-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.avatar-icon-group svg {
    color: var(--primary-glow);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.avatar-label {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.avatar-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Hero Text Content */
.hero-intro h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-glow);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
}

.hero-name {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--text-secondary) 70%, var(--primary-glow));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.hero-desc {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-actions-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
    .hero-actions-row {
        justify-content: center;
    }
}

.social-icons-row {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.social-icons-row a {
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-icons-row a:hover {
    color: var(--primary-glow) !important;
    transform: translateY(-2px) scale(1.15);
}

/* Main Sections Layout */
.portfolio-section {
    max-width: 1000px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.section-header {
    margin-bottom: 3rem;
    position: relative;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header h2 svg {
    color: var(--primary-glow);
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-glow), var(--secondary-glow));
    border-radius: 2px;
}

@media (max-width: 900px) {
    .section-header::after {
        left: 50%;
        transform: translateX(-50%);
    }
    .section-header {
        text-align: center;
    }
    .section-header h2 {
        justify-content: center;
    }
}

/* Who Am I Cards Grid */
.whoami-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.whoami-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 2rem;
    box-shadow: 0 8px 32px var(--shadow-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
}

.whoami-card:hover {
    transform: translateY(-5px) scale(1.01);
    border-color: hsla(var(--hue-primary), 100%, 65%, 0.35);
    box-shadow: 0 16px 40px rgba(var(--hue-primary), 100%, 60%, 0.12);
}

.whoami-card:nth-child(2):hover {
    border-color: hsla(var(--hue-secondary), 90%, 65%, 0.35);
    box-shadow: 0 16px 40px rgba(var(--hue-secondary), 90%, 65%, 0.1);
}

.whoami-card:nth-child(3):hover {
    border-color: hsla(var(--hue-success), 80%, 50%, 0.35);
    box-shadow: 0 16px 40px rgba(var(--hue-success), 80%, 50%, 0.1);
}

.whoami-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: hsla(var(--hue-primary), 100%, 60%, 0.1);
    color: var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.whoami-card:nth-child(2) .whoami-icon {
    background: hsla(var(--hue-secondary), 90%, 65%, 0.1);
    color: var(--secondary-glow);
}

.whoami-card:nth-child(3) .whoami-icon {
    background: hsla(var(--hue-success), 80%, 50%, 0.1);
    color: var(--success-glow);
}

.whoami-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.whoami-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Experience Timeline */
.timeline-container {
    position: relative;
    padding-left: 2rem;
    margin-left: 1rem;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-glow), var(--secondary-glow) 70%, var(--border-color));
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-item:last-child {
    margin-bottom: 1rem;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-gradient-start);
    border: 3px solid var(--primary-glow);
    box-shadow: 0 0 10px var(--primary-glow);
    z-index: 2;
    transition: var(--transition-smooth);
}

.timeline-item:hover .timeline-dot {
    background: var(--primary-glow);
    transform: translateX(-50%) scale(1.2);
}

.timeline-item:nth-child(even) .timeline-dot {
    border-color: var(--secondary-glow);
    box-shadow: 0 0 10px var(--secondary-glow);
}

.timeline-item:nth-child(even):hover .timeline-dot {
    background: var(--secondary-glow);
}

.timeline-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 1.75rem;
    box-shadow: 0 8px 32px var(--shadow-color);
    backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
}

.timeline-item:hover .timeline-content {
    transform: translateY(-4px) scale(1.005);
    border-color: hsla(var(--hue-primary), 100%, 65%, 0.35);
    box-shadow: 0 16px 40px rgba(var(--hue-primary), 100%, 60%, 0.1);
}

.timeline-item:nth-child(even):hover .timeline-content {
    border-color: hsla(var(--hue-secondary), 90%, 65%, 0.35);
    box-shadow: 0 16px 40px rgba(var(--hue-secondary), 90%, 65%, 0.08);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.timeline-role-org h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.timeline-role-org .org {
    color: var(--primary-glow);
    font-weight: 600;
}

.timeline-item:nth-child(even) .timeline-role-org .org {
    color: var(--secondary-glow);
}

.timeline-date {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--console-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.timeline-body p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.timeline-tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--border-color);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--card-border);
}

/* Projects Card Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 1.75rem;
    box-shadow: 0 8px 32px var(--shadow-color);
    backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-5px) scale(1.01);
    border-color: hsla(var(--hue-primary), 100%, 65%, 0.35);
    box-shadow: 0 16px 40px rgba(var(--hue-primary), 100%, 60%, 0.12);
}

/* Dashboard Featured Glow */
.project-card.featured-dashboard {
    background: linear-gradient(135deg, var(--card-bg), hsla(var(--hue-primary), 100%, 60%, 0.05));
    border-color: hsla(var(--hue-primary), 100%, 60%, 0.3);
    box-shadow: 0 10px 35px rgba(var(--hue-primary), 100%, 60%, 0.1);
}

.project-card.featured-dashboard:hover {
    border-color: var(--primary-glow);
    box-shadow: 0 16px 45px rgba(var(--hue-primary), 100%, 60%, 0.2);
}

.project-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

.project-meta {
    margin-bottom: 1.5rem;
}

.project-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--console-bg);
    color: var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    border: 1px solid var(--card-border);
}

.project-card h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.project-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1rem;
}

.project-tech-tag {
    font-size: 0.7rem;
    font-family: monospace;
    color: var(--text-muted);
    background: var(--console-bg);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.project-links {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
}

.project-link-btn {
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition-smooth);
}

.project-link-btn.primary {
    color: var(--primary-glow);
}

.project-link-btn.primary:hover {
    color: var(--text-primary);
    transform: translateX(2px);
}

.project-link-btn.secondary {
    color: var(--text-muted);
}

.project-link-btn.secondary:hover {
    color: var(--text-primary);
}

/* Skills Cards Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.skills-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 1.75rem;
    box-shadow: 0 8px 32px var(--shadow-color);
    backdrop-filter: blur(12px);
}

.skills-card h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.skill-bar-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
}

.skill-bar-name {
    color: var(--text-secondary);
}

.skill-bar-val {
    color: var(--primary-glow);
}

.skills-card:nth-child(2) .skill-bar-val {
    color: var(--secondary-glow);
}

.skills-card:nth-child(3) .skill-bar-val {
    color: var(--success-glow);
}

.skill-bar-outer {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.skill-bar-inner {
    height: 100%;
    border-radius: 3px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* -------------------------------------------------------------
   SCROLL-DRIVEN ENTRY/EXIT REVEAL ANIMATIONS
   ------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
    @supports ((animation-timeline: view()) and (animation-range: entry)) {
        @keyframes fade-scale-in {
            from {
                opacity: 0;
                transform: translateY(35px) scale(0.96);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .scroll-animate {
            /* Declare animation-timeline after shorthand to prevent resets */
            animation: fade-scale-in auto cubic-bezier(0.25, 1, 0.5, 1) both;
            animation-timeline: view();
            animation-range: entry 10% entry 45%;
        }
    }
}

/* Fallback for JS scroll entry (adds class active via IntersectionObserver, only when view-timeline unsupported) */
@supports not ((animation-timeline: view()) and (animation-range: entry)) {
    .scroll-animate-js {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
        transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    }
    
    .scroll-animate-js.active {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Education and Languages grid */
.edu-lang-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .edu-lang-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Hutta Sandbox Card */
.whoami-card.hutta-card {
    background: linear-gradient(135deg, var(--card-bg), hsla(var(--hue-secondary), 90%, 65%, 0.04));
    border-color: hsla(var(--hue-secondary), 90%, 65%, 0.2);
    max-width: 440px;
    width: 100%;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    text-align: left;
    margin: 0;
}

.hutta-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.hutta-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: hsla(var(--hue-secondary), 90%, 65%, 0.1);
    color: var(--secondary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hutta-card-content {
    flex: 1;
    min-width: 200px;
}

.hutta-card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.hutta-card-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

/* Education List */
.edu-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.edu-item {
    display: flex;
    flex-direction: column;
}

.edu-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.edu-icon {
    color: var(--primary-glow);
    flex-shrink: 0;
}

.edu-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    padding-left: 1.5rem; /* Indent to line up with title text after icon */
}

/* Languages List spacing */
.skills-list.lang-list {
    margin-top: 0.5rem;
}

/* -------------------------------------------------------------
   SCROLL REVEAL STAGGER ANIMATIONS
   ------------------------------------------------------------- */
.whoami-card.scroll-animate-js:nth-child(1) { transition-delay: 0.05s; }
.whoami-card.scroll-animate-js:nth-child(2) { transition-delay: 0.15s; }
.whoami-card.scroll-animate-js:nth-child(3) { transition-delay: 0.25s; }

.timeline-item.scroll-animate-js:nth-child(1) { transition-delay: 0.05s; }
.timeline-item.scroll-animate-js:nth-child(2) { transition-delay: 0.1s; }
.timeline-item.scroll-animate-js:nth-child(3) { transition-delay: 0.15s; }
.timeline-item.scroll-animate-js:nth-child(4) { transition-delay: 0.2s; }

.project-card.scroll-animate-js:nth-child(1) { transition-delay: 0.05s; }
.project-card.scroll-animate-js:nth-child(2) { transition-delay: 0.1s; }
.project-card.scroll-animate-js:nth-child(3) { transition-delay: 0.15s; }
.project-card.scroll-animate-js:nth-child(4) { transition-delay: 0.2s; }
.project-card.scroll-animate-js:nth-child(5) { transition-delay: 0.25s; }
.project-card.scroll-animate-js:nth-child(6) { transition-delay: 0.3s; }

/* ─────────────────────────────────────────────────────────────────────────────
   MOBILE STYLING IMPROVEMENTS & RESPONSIVE POLISHING
   ───────────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    /* Hero section centering and optimization */
    .portfolio-hero {
        padding: 6rem 1.25rem 3rem 1.25rem !important;
        min-height: auto !important;
    }
    
    .portfolio-section {
        padding: 0 1.25rem !important;
        margin: 3rem auto !important;
    }

    @media (max-width: 380px) {
        .profile-photo-wrap,
        .profile-photo {
            width: 220px !important;
            height: 220px !important;
        }
    }
    .hero-container-inner {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center !important;
    }
    .profile-showcase {
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
    .whoami-caption {
        max-width: 320px !important;
        margin-top: 0.5rem !important;
        text-align: center !important;
    }
    .hero-actions-row {
        justify-content: center !important;
        gap: 0.75rem !important;
    }

    /* About Cards Grid */
    .whoami-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }
    .whoami-card {
        padding: 1.25rem !important;
    }

    /* Experience Timeline mobile optimization */
    .timeline-container {
        padding-left: 1.25rem !important;
        margin-left: 0.5rem !important;
    }
    .timeline-dot {
        left: -1.25rem !important;
        width: 12px !important;
        height: 12px !important;
    }
    .timeline-content {
        padding: 1.25rem !important;
    }
    .timeline-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.35rem !important;
    }
    .timeline-date {
        margin-top: 0.25rem;
    }

    /* Projects grid */
    .projects-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Skills Grid */
    .skills-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }
    .skills-card {
        padding: 1.25rem !important;
    }

    /* ── Developer Tools Mobile Fixes ── */
    .tools-dashboard-grid {
        padding: 0 0.75rem !important;
        margin: 1rem auto !important;
        gap: 1rem !important;
    }
    
    .tools-content {
        padding: 1rem !important;
    }
    
    .crypto-config-box {
        height: auto !important;
        padding: 0.85rem !important;
        gap: 0.8rem !important;
    }
    
    /* JWT segment responsive flex output */
    .jwt-output-container {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    /* Wrap file upload buttons and long labels inside Crypto Tool */
    #crypto-key-import-group > div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    #crypto-key-import-group button {
        padding: 0.25rem 0.5rem !important;
    }

    /* IP CIDR Calculator Binary Vis block: stack row labels and values vertically */
    #ip-cidr-calc div[style*="monospace"] > div {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.2rem !important;
        border-bottom: 1px dashed rgba(255, 255, 255, 0.05) !important;
        padding-bottom: 0.4rem !important;
    }
    #ip-cidr-calc div[style*="monospace"] span[style*="width: 140px"] {
        width: auto !important;
        color: var(--text-primary) !important;
        font-weight: 600 !important;
    }
}

@media (max-width: 480px) {
    /* Tighten typography sizing for small phone screens */
    .hero-name {
        font-size: 2.2rem !important;
    }
    .hero-title {
        font-size: 1.2rem !important;
    }
    .portfolio-section h2 {
        font-size: 1.75rem !important;
    }
    .timeline-role-org h3 {
        font-size: 1.15rem !important;
    }
    .nav-menu {
        gap: 0.85rem !important;
    }
    .nav-link {
        font-size: 0.8rem !important;
        padding: 0.2rem 0.35rem !important;
    }
}

/* ── Contact Dialog Modal ─────────────────────────────────────────────────── */
.contact-dialog-modal {
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius-md);
    padding: 0;
    max-width: 500px;
    width: 90%;
    color: var(--text-primary);
    box-shadow: 0 20px 80px var(--shadow-color);
    z-index: 10000;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.contact-dialog-modal::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fade-in 0.3s ease forwards;
}

.contact-dialog-modal[open] {
    animation: zoom-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes zoom-in {
    from { transform: translate(-50%, -50%) scale(0.95); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dialog-content {
    padding: 2rem;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.dialog-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--primary-glow));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.close-dialog-btn {
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem;
    border-radius: 50%;
    border: 1.5px solid transparent;
    background: transparent;
    transition: var(--transition-smooth);
}

.close-dialog-btn:hover {
    color: var(--warning-glow);
    background: rgba(240, 70, 70, 0.1);
    border-color: rgba(240, 70, 70, 0.2);
}

.contact-form-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    background: var(--console-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-glow);
    box-shadow: 0 0 8px hsla(var(--hue-primary), 100%, 60%, 0.2);
}

.form-textarea {
    resize: vertical;
}

.form-submit-btn {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
}

@media (max-width: 480px) {
    .dialog-content {
        padding: 1.25rem;
    }
    .dialog-header h2 {
        font-size: 1.25rem;
    }
    .form-submit-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ── Messages Dialog Modal ────────────────────────────────────────────────── */
.message-card {
    background: var(--console-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.message-card.removing {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
}

.message-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.message-sender-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.message-sender-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.message-sender-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.message-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.message-actions {
    display: flex;
    gap: 0.5rem;
}

.message-delete-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--border-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.message-delete-btn:hover {
    color: var(--warning-glow);
    background: rgba(240, 70, 70, 0.1);
    border-color: rgba(240, 70, 70, 0.2);
}

.message-subject {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary-glow);
    border-top: 1px dashed var(--card-border);
    padding-top: 0.5rem;
}

.message-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
}

.no-messages-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    gap: 1rem;
}

.messages-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 0;
}

.messages-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-glow);
    animation: messages-spin 1s ease-in-out infinite;
}

@keyframes messages-spin {
    to { transform: rotate(360deg); }
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

/* IoT-specific Dashboard Grid Override */
.iot-dashboard-grid {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 991px) {
    .iot-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard Page Header */
.dashboard-page-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.dashboard-page-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.dashboard-page-header p {
    color: var(--text-secondary);
    margin-top: 0.35rem;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.dashboard-title-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.dashboard-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(79, 172, 254, 0.05));
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-glow);
    box-shadow: 0 4px 12px var(--shadow-color);
    flex-shrink: 0;
}

.dashboard-icon-wrapper svg {
    width: 22px;
    height: 22px;
}

/* Refresh Indicator */
.refresh-indicator {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 0.45rem 1.1rem;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
}

.refresh-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success-glow, #4ade80);
    box-shadow: 0 0 10px var(--success-glow, rgba(74, 222, 128, 0.4));
    animation: refresh-pulse 2s infinite;
}

@keyframes refresh-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
