@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&family=Montserrat:wght@500;700&display=swap');

/* ==========================================================================
   1. COLOR VARIABLES & LIGHT MODE OVERRIDE
   ========================================================================== */
:root {
    --bg-gradient: radial-gradient(circle at center, #12181f 0%, #050507 100%);
    --card-bg: rgba(15, 18, 24, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
    --card-hover-shadow: 0 20px 50px rgba(0, 173, 181, 0.15);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent: #06b6d4;
    --accent-glow: rgba(6, 182, 212, 0.35);
    
    --social-bg: rgba(255, 255, 255, 0.05);
    --social-hover-bg: rgba(6, 182, 212, 0.15);
    --bubble-bg: rgba(255, 255, 255, 0.03);
    
    --btn-other-bg: rgba(255, 255, 255, 0.04);
    --btn-text: #f8fafc;
}

body.light-mode {
    --bg-gradient: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 50%, #f3e8ff 100%) !important;
    --card-bg: rgba(255, 255, 255, 0.85) !important;
    --card-border: rgba(0, 0, 0, 0.08) !important;
    --card-shadow: 0 12px 35px rgba(14, 116, 144, 0.08) !important;
    --card-hover-shadow: 0 20px 40px rgba(14, 116, 144, 0.15) !important;
    
    --text-primary: #0f172a !important;
    --text-secondary: #334155 !important;
    --text-muted: #64748b !important;
    
    --accent: #0284c7 !important;
    --accent-glow: rgba(2, 132, 199, 0.25) !important;
    
    --social-bg: rgba(0, 0, 0, 0.04) !important;
    --social-hover-bg: rgba(2, 132, 199, 0.12) !important;
    --bubble-bg: rgba(2, 132, 199, 0.06) !important;
    
    --btn-other-bg: rgba(0, 0, 0, 0.04) !important;
    --btn-text: #0f172a !important;
}

/* ==========================================================================
   2. GLOBAL RESET
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-gradient);
    color: var(--text-primary);
    transition: background 0.4s ease, color 0.4s ease;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    user-select: none;
}

canvas {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2;
}

.bg-bubbles {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-bubbles li {
    position: absolute;
    list-style: none;
    width: 35px; height: 35px;
    background-color: var(--bubble-bg);
    bottom: -160px;
    animation: square 25s infinite linear;
    border-radius: 6px;
    transition: background-color 0.4s ease;
}

@keyframes square {
    0% { transform: translateY(0) rotate(0deg); opacity: 0.6; }
    100% { transform: translateY(-1000px) rotate(720deg); opacity: 0; }
}

/* ==========================================================================
   3. PROFILE CARD
   ========================================================================== */
.profile-card {
    width: 100%;
    max-width: 380px;
    background: var(--card-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 24px;
    padding: 26px;
    text-align: center;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.4s ease, border-color 0.4s ease;
    z-index: 10;
}

.profile-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-hover-shadow);
}

.profile-img-container {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
}

.profile-img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin: 0 auto;
    overflow: hidden;
    border: 3px solid var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    transition: transform 0.3s ease, border-color 0.4s ease;
}

.profile-img:hover {
    transform: scale(1.05);
}

.profile-img img {
    width: 100%; height: 100%; object-fit: cover;
}

.greeting-bubble {
    position: absolute;
    top: -6px;
    left: 80px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    box-shadow: var(--card-shadow);
    z-index: 12;
    animation: bubbleFloat 3s ease-in-out infinite alternate;
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.bubble-divider { color: var(--text-muted); }
.greeting-bubble i { color: var(--accent); }

@keyframes bubbleFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}

.profile-titles h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-primary);
    transition: color 0.4s ease;
}

.profile-titles p.role {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    transition: color 0.4s ease;
}

.cursor {
    color: var(--accent);
    font-weight: 600;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ==========================================================================
   4. EKG WAVEFORM
   ========================================================================== */
.ekg-container {
    width: 100%;
    height: 24px;
    margin: 4px 0 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ekg-container svg {
    width: 110px;
    height: 100%;
    color: var(--accent);
    fill: none !important;
    stroke: var(--accent);
    stroke-width: 2.2px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 260;
    animation: ekgHeartbeat 2.2s cubic-bezier(0, 0, 0.58, 1) infinite;
    filter: drop-shadow(0 0 6px var(--accent-glow));
    transition: stroke 0.4s ease, color 0.4s ease;
}

@keyframes ekgHeartbeat {
    0% { stroke-dashoffset: 260; }
    100% { stroke-dashoffset: -260; }
}

/* ==========================================================================
   5. LOCATION & WEATHER
   ========================================================================== */
.location-wrapper {
    margin-bottom: 14px;
    display: flex;
    justify-content: center;
}

.location-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--social-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.location-badge i { color: var(--accent); }

.location-badge:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--social-hover-bg);
    transform: translateY(-2px);
}

.weather-popover {
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-primary);
    white-space: nowrap;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 10;
}

.weather-popover i { color: var(--accent); }

.location-badge:hover .weather-popover {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   6. ACTION BUTTONS & SOCIAL ICONS
   ========================================================================== */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 14px;
}

.other-btn {
    flex: 1;
    max-width: 130px;
    background: var(--btn-other-bg);
    border: 1px solid var(--card-border);
    padding: 9px 14px;
    color: var(--btn-text);
    font-weight: 600;
    font-size: 13px;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.other-btn:hover {
    color: #ffffff;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 15px var(--accent-glow);
    transform: translateY(-2px);
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--social-bg);
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid var(--card-border);
}

.social-icons a:hover {
    background: var(--social-hover-bg);
    transform: translateY(-3px);
    border-color: var(--accent);
    color: var(--accent);
}

.social-icons a:hover .fa-instagram { color: #e1306c; }

/* ==========================================================================
   7. FIXED WIDGETS
   ========================================================================== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, background 0.4s ease, border-color 0.4s ease;
    z-index: 100;
}

.theme-toggle:hover { transform: scale(1.1); }
.theme-toggle i { font-size: 16px; color: var(--text-primary); transition: color 0.4s ease; }

.ping-badge-fixed {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    z-index: 100;
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.ping-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.time-badge-fixed {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    z-index: 100;
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.time-badge-fixed i { color: var(--accent); }

.footer-badge-fixed {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
    z-index: 100;
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.footer-badge-fixed strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ==========================================================================
   7.5. MUSIC TOGGLE BUTTON
   ========================================================================== */
.music-toggle {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, background 0.4s ease, border-color 0.4s ease;
    z-index: 100;
}
.music-toggle:hover {
    transform: translateX(-50%) scale(1.1);
}

/* Music bars animation */
.music-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 22px;
    height: 22px;
}
.music-bar {
    width: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: background 0.4s ease;
}
.bar-1 { height: 8px; }
.bar-2 { height: 14px; }
.bar-3 { height: 10px; }

/* Playing state animation */
.music-toggle.playing .bar-1 {
    animation: musicBounce1 0.6s ease-in-out infinite;
}
.music-toggle.playing .bar-2 {
    animation: musicBounce2 0.6s ease-in-out infinite 0.1s;
}
.music-toggle.playing .bar-3 {
    animation: musicBounce3 0.6s ease-in-out infinite 0.2s;
}
@keyframes musicBounce1 {
    0%, 100% { height: 8px; }
    50% { height: 16px; }
}
@keyframes musicBounce2 {
    0%, 100% { height: 14px; }
    50% { height: 22px; }
}
@keyframes musicBounce3 {
    0%, 100% { height: 10px; }
    50% { height: 18px; }
}

/* Paused state */
.music-toggle.paused .music-bar {
    opacity: 0.5;
}

/* Tooltip styling adjustment for music toggle */
.music-toggle:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 10px;
    color: var(--text-primary);
    white-space: nowrap;
    box-shadow: var(--card-shadow);
    opacity: 0;
    animation: tooltipFade 0.2s ease forwards;
}
@keyframes tooltipFade {
    to { opacity: 1; }
}

/* Responsive adjustment */
@media (max-width: 480px) {
    .music-toggle {
        bottom: 15px;
        width: 40px;
        height: 40px;
    }
}

/* ==========================================================================
   8. PAGE LOADER & TOAST
   ========================================================================== */
.page-loader {
    width: 100%; height: 100vh;
    position: fixed; top: 0; left: 0;
    background: var(--bg-gradient);
    z-index: 99999;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0; visibility: hidden; pointer-events: none;
}

.page-loader .txt {
    color: var(--text-primary);
    text-align: center; margin-top: 25px;
    letter-spacing: 0.25rem; font-weight: 600;
    font-size: 13px; text-transform: uppercase;
}

.spinner {
    width: 48px; height: 48px; position: relative;
}

.spinner:before {
    content: ''; width: 48px; height: 5px;
    background: #000; opacity: 0.25;
    position: absolute; top: 60px; left: 0;
    border-radius: 50%;
    animation: shadow 0.5s linear infinite;
}

.spinner:after {
    content: ''; width: 100%; height: 100%;
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    animation: bxSpin 0.5s linear infinite;
    position: absolute; top: 0; left: 0;
    border-radius: 6px;
}

@keyframes bxSpin {
    17% { border-bottom-right-radius: 3px; }
    25% { transform: translateY(9px) rotate(22.5deg); }
    50% { transform: translateY(18px) scale(1, .9) rotate(45deg); border-bottom-right-radius: 40px; }
    75% { transform: translateY(9px) rotate(67.5deg); }
    100% { transform: translateY(0) rotate(90deg); }
}

@keyframes shadow {
    0%, 100% { transform: scale(1, 1); }
    50% { transform: scale(1.2, 1); }
}

.toast-notice {
    position: fixed;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    border: 1px solid var(--accent);
    color: var(--text-primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    backdrop-filter: blur(12px);
    box-shadow: var(--card-shadow);
    transition: bottom 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
}

.toast-notice.show { bottom: 25px; }

@media (max-width: 480px) {
    .greeting-bubble {
        position: relative;
        top: 0; left: 0;
        margin: 0 auto 10px auto;
        display: inline-flex;
    }
}