/* =====================================================
   GLASSMORPHISM DASHBOARD - STYLES
   ===================================================== */

/* CSS Variables */
:root {
    --purple-dark: #4a1a62;
    --purple-primary: #5a2a82;
    --purple-mid: #7a5a92;
    --purple-light: #9a73b3;

    --glass-bg: rgba(15, 5, 20, 0.25);
    --glass-bg-light: rgba(30, 15, 45, 0.2);
    --glass-border: rgba(154, 115, 179, 0.3);
    --glass-glow: rgba(90, 42, 130, 0.5);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-tertiary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);

    --card-radius: 20px;
    --card-blur: 20px;
    --card-max-width: 50vw;

    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    background: #000000;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* =====================================================
   LOADING OVERLAY
   ===================================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 5, 15, 0.98);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.liquid-loader {
    width: 120px;
    height: 120px;
    background-color: var(--purple-primary);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 30px 4px rgba(0, 0, 0, 0.5) inset,
        0 5px 20px rgba(90, 42, 130, 0.4);
    overflow: hidden;
}

.liquid-loader::before,
.liquid-loader::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 45%;
    top: -40%;
    background-color: #fff;
    animation: wave 5s linear infinite;
}

.liquid-loader::before {
    border-radius: 30%;
    background: rgba(255, 255, 255, 0.4);
    animation: wave 5s linear infinite;
}

.liquid-loader::after {
    border-radius: 40%;
    background: rgba(255, 255, 255, 0.6);
    animation: wave 7s linear infinite reverse;
}

@keyframes wave {
    0% {
        transform: rotate(0);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 30px;
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 1px;
}

/* =====================================================
   ABSTRACT BACKGROUND
   ===================================================== */

.background-container {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: -1;
    overflow: hidden;
    background: #000000;
}

/* Gradient Orbs */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
    will-change: transform;
}

.bg-orb-1 {
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--purple-primary) 0%, transparent 70%);
    top: 20%;
    left: 10%;
    animation: floatOrb1 40s ease-in-out infinite;
}

.bg-orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--purple-light) 0%, transparent 70%);
    top: 50%;
    right: 20%;
    animation: floatOrb2 35s ease-in-out infinite;
}

.bg-orb-3 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--purple-dark) 0%, transparent 70%);
    bottom: 30%;
    left: 30%;
    animation: floatOrb3 45s ease-in-out infinite;
}

.bg-orb-4 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--purple-mid) 0%, transparent 70%);
    top: 70%;
    left: 60%;
    animation: floatOrb4 38s ease-in-out infinite;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(50px, 30px); }
    50% { transform: translate(20px, -40px); }
    75% { transform: translate(-30px, 20px); }
}

@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-40px, 50px); }
    50% { transform: translate(30px, 20px); }
    75% { transform: translate(50px, -30px); }
}

@keyframes floatOrb3 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(30px, -50px); }
    50% { transform: translate(-40px, 30px); }
    75% { transform: translate(20px, 40px); }
}

@keyframes floatOrb4 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-50px, -30px); }
    50% { transform: translate(40px, 50px); }
    75% { transform: translate(-30px, -40px); }
}

/* Smoky Wisps */
.bg-smoke {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.04;
    background-size: cover;
    background-position: center;
}

.bg-smoke-1 {
    background: linear-gradient(
        135deg,
        transparent 0%,
        var(--purple-dark) 25%,
        transparent 50%,
        var(--purple-primary) 75%,
        transparent 100%
    );
    animation: smoke-drift 60s ease-in-out infinite;
}

.bg-smoke-2 {
    background: linear-gradient(
        -135deg,
        transparent 0%,
        var(--purple-mid) 30%,
        transparent 60%,
        var(--purple-light) 80%,
        transparent 100%
    );
    animation: smoke-drift 50s ease-in-out infinite reverse;
    animation-delay: -15s;
}

@keyframes smoke-drift {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
        opacity: 0.04;
    }
    50% {
        transform: translateX(30px) rotate(2deg);
        opacity: 0.06;
    }
}

/* =====================================================
   MAIN CONTAINER
   ===================================================== */

.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    gap: 60px;
    min-height: 100vh;
}

/* =====================================================
   GLASSMORPHISM CARDS
   ===================================================== */

.glass-card {
    width: 100%;
    max-width: var(--card-max-width);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
    border-radius: var(--card-radius);
    border: 1px solid var(--glass-border);
    box-shadow:
        0 0 40px var(--glass-glow),
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;

    /* Scroll Animation Setup */
    opacity: 0;
    transform: translateY(40px);
    transition: var(--transition-smooth);
}

.glass-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Gradient Border Effect */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--card-radius);
    padding: 1px;
    background: linear-gradient(
        135deg,
        var(--purple-primary),
        var(--purple-light),
        var(--purple-mid),
        var(--purple-dark)
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.5;
}

.card-content {
    padding: 40px;
}

.card-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 28px;
    color: var(--text-primary);
    text-align: center;
}

/* =====================================================
   CARD 1: GREETING
   ===================================================== */

.card-greeting .card-content {
    text-align: center;
}

.greeting-section {
    margin-bottom: 30px;
}

.greeting-text {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--purple-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.greeting-message {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.date-time-section {
    margin-bottom: 30px;
}

.current-date {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 300;
}

.time-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
}

.time-main {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -2px;
}

.time-seconds {
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.time-period {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-tertiary);
    margin-left: 8px;
}

.location-section {
    margin-bottom: 30px;
}

.location-name {
    font-size: 1.3rem;
    color: var(--text-primary);
    font-weight: 500;
}

.location-coords {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: monospace;
}

.city-image-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    background: var(--glass-bg-light);
    border: 1px solid var(--glass-border);
}

.city-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.city-image.loaded {
    display: block;
}

.image-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-tertiary);
}

.image-loading.hidden {
    display: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--purple-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* =====================================================
   CARD 2: WEATHER
   ===================================================== */

.weather-location {
    text-align: center;
    margin-bottom: 30px;
}

.weather-city {
    font-size: 1.3rem;
    font-weight: 500;
}

.weather-coords {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: monospace;
}

.weather-main {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    margin-bottom: 40px;
}

.current-weather {
    text-align: center;
    flex: 1;
    min-width: 200px;
}

.weather-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 10px;
}

.weather-temp-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 8px;
}

.current-temp {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
}

.temp-unit {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-secondary);
}

.weather-condition {
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    flex: 1;
    min-width: 200px;
}

.weather-detail {
    background: var(--glass-bg-light);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(154, 115, 179, 0.15);
}

.detail-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 500;
}

.forecast-container {
    border-top: 1px solid var(--glass-border);
    padding-top: 30px;
}

.forecast-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-align: center;
}

.forecast-grid {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.forecast-item {
    background: var(--glass-bg-light);
    padding: 20px 15px;
    border-radius: 16px;
    text-align: center;
    flex: 1;
    border: 1px solid rgba(154, 115, 179, 0.15);
    transition: var(--transition-smooth);
}

.forecast-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--glass-glow);
}

.forecast-day {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.forecast-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
}

.forecast-condition {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    text-transform: capitalize;
}

.forecast-temps {
    font-size: 0.95rem;
}

.forecast-high {
    font-weight: 500;
}

.forecast-low {
    color: var(--text-muted);
}

/* =====================================================
   TICKER TAPE
   ===================================================== */

.ticker-container {
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    position: relative;
}

.ticker-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 10;
    pointer-events: none;
}

.ticker-fade-left {
    left: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 1) 0%, transparent 100%);
}

.ticker-fade-right {
    right: 0;
    background: linear-gradient(to left, rgba(0, 0, 0, 1) 0%, transparent 100%);
}

.ticker-container tv-ticker-tape {
    width: 100%;
}

/* Hide TradingView branding in ticker */
.ticker-container tv-branding,
.ticker-container .bottom-link {
    display: none !important;
}

/* =====================================================
   CARD 3: NEWS
   ===================================================== */

.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.news-card {
    background: var(--glass-bg-light);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(154, 115, 179, 0.15);
    transition: var(--transition-smooth);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px var(--glass-glow);
    border-color: var(--purple-light);
}

.news-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-content {
    padding: 20px;
}

.news-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-description {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-tertiary);
}

/* =====================================================
   CARD 4: FINANCE
   ===================================================== */

.finance-widgets {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.widget-section {
    width: 100%;
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.tradingview-widget-container {
    border-radius: 12px;
    overflow: hidden;
}

/* Hide TradingView copyright */
.tradingview-widget-copyright {
    font-size: 0.7rem !important;
    opacity: 0.4 !important;
}

/* =====================================================
   CARD 5: AURORA
   ===================================================== */

.aurora-info {
    margin-bottom: 40px;
}

.aurora-blurb p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 0.95rem;
    line-height: 1.7;
}

.aurora-blurb strong {
    color: var(--purple-light);
}

.aurora-data {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.kp-chart-container {
    background: var(--glass-bg-light);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(154, 115, 179, 0.15);
}

.section-subtitle {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-align: center;
}

#kp-chart {
    width: 100% !important;
    max-height: 300px;
}

.aurora-animation-container {
    background: var(--glass-bg-light);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(154, 115, 179, 0.15);
}

.aurora-viewer {
    text-align: center;
}

.aurora-image {
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    margin-bottom: 15px;
}

.aurora-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.aurora-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.aurora-btn:hover {
    background: var(--purple-primary);
    border-color: var(--purple-light);
}

.aurora-timestamp {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    font-family: monospace;
}

/* =====================================================
   CARD 6: FOOTER
   ===================================================== */

.card-footer {
    padding: 20px 0;
}

.card-footer .card-content {
    padding: 30px 40px;
}

.footer-content {
    text-align: center;
}

.footer-main {
    margin-bottom: 25px;
}

.build-credit {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.tagline {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--text-muted);
}

.footer-contact {
    margin-bottom: 25px;
}

.contact-link {
    color: var(--purple-light);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.contact-link:hover {
    color: var(--text-primary);
}

.footer-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

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

.footer-link {
    font-size: 0.85rem;
    color: var(--purple-light);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.footer-link:hover {
    color: var(--text-primary);
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 1200px) {
    :root {
        --card-max-width: 70vw;
    }
}

@media (max-width: 768px) {
    :root {
        --card-max-width: 95vw;
    }

    .main-container {
        padding: 40px 15px;
        gap: 40px;
    }

    .card-content {
        padding: 25px;
    }

    .card-title {
        font-size: 1.5rem;
    }

    .greeting-text {
        font-size: 2rem;
    }

    .time-main {
        font-size: 3rem;
    }

    .time-seconds {
        font-size: 1.5rem;
    }

    .weather-main {
        flex-direction: column;
    }

    .weather-details {
        grid-template-columns: repeat(2, 1fr);
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .forecast-grid {
        flex-direction: column;
        gap: 15px;
    }

    .forecast-item {
        flex: none;
        width: 100%;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
    }

    .ticker-fade {
        width: 40px;
    }
}

@media (max-width: 480px) {
    .greeting-text {
        font-size: 1.75rem;
    }

    .time-main {
        font-size: 2.5rem;
    }

    .time-seconds {
        font-size: 1.25rem;
    }

    .current-temp {
        font-size: 3rem;
    }

    .weather-details {
        grid-template-columns: 1fr;
    }

    .city-image-container {
        max-width: 300px;
    }
}

/* =====================================================
   ANIMATION CLASSES
   ===================================================== */

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

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

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* =====================================================
   UTILITY CLASSES
   ===================================================== */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

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