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

:root {
    --primary-purple: #5a2a82;
    --secondary-purple: #9a73b3;
    --tertiary-purple: #7a5a92;
    --dark-purple: #4a1a62;
    --glass-bg: rgba(20, 10, 30, 0.6);
    --glass-bg-light: rgba(40, 20, 60, 0.4);
    --blur-amount: 20px;
    --white: #ffffff;
    --black: #000000;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #000000;
    color: rgba(255,255,255,0.95);
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    overflow-x: hidden;
    position: relative;
}

/* Slightly brighter muted text */
::selection { background: rgba(154,115,179,0.2); }
.muted { color: rgba(255,255,255,0.78); }

/* Page loader overlay (full-screen) */
.page-loader {
        position: fixed;
        inset: 0;
        background: rgba(10,8,12,0.95);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 9999;
        transition: opacity 0.35s ease, visibility 0.35s ease;
}
.page-loader.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }

/* Loader animation: purple ball on white platforms (adapted) */
.loader {
    height: 60px;
    aspect-ratio: 2;
    border-bottom: 3px solid #0000;
    background:
        linear-gradient(90deg, #ffffff 50%, #0000 0)
        -25% 100%/50% 3px repeat-x border-box;
    position: relative;
    animation: l3-0 .75s linear infinite;
    width: 120px;
}
.loader:before {
    content: "";
    position: absolute;
    inset: auto 42.5% 0;
    aspect-ratio: 1;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--secondary-purple), var(--primary-purple));
    animation: l3-1 .75s cubic-bezier(0,900,1,900) infinite;
}
@keyframes l3-0 { to {background-position: -125% 100%} }
@keyframes l3-1 { 0%,2% {bottom: 0%} 98%,to {bottom:.1%} }

/* Background Canvas with Abstract Elements */
.background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0a0005 0%, #1a0a2e 50%, #000000 100%);
    z-index: -2;
    pointer-events: none;
}

.background-canvas::before,
.background-canvas::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}

.background-canvas::before {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--primary-purple), transparent);
    top: 10%;
    left: 5%;
    animation: float 20s ease-in-out infinite;
}

.background-canvas::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary-purple), transparent);
    bottom: 5%;
    right: 5%;
    animation: float 25s ease-in-out infinite reverse;
}

/* Additional abstract background elements */
.background-canvas {
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(90, 42, 130, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(154, 115, 179, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 100%, rgba(74, 26, 98, 0.1) 0%, transparent 50%);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-30px);
    }
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* Cards */
.card {
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(20, 10, 30, 0.55));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    backdrop-filter: blur(var(--blur-amount));
    border-radius: 22px;
    padding: 40px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.8s ease-out;
    opacity: 0;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 22px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(90,42,130,0.2), rgba(154,115,179,0.12));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.card::after {
    content: '';
    position: absolute;
    left: -30%;
    top: -30%;
    width: 160%;
    height: 160%;
    background: radial-gradient(closest-side, rgba(154,115,179,0.12), transparent 40%);
    filter: blur(40px);
    opacity: 0.9;
    pointer-events: none;
    mix-blend-mode: screen;
}

.card.visible {
    opacity: 1;
}

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

.card-title {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--secondary-purple), var(--white));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-content {
    position: relative;
}

/* Card 1: Greeting & City */
.card-1 {
    text-align: center;
}

.greeting {
    font-size: 48px;
    font-weight: 500;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--secondary-purple), var(--white));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.friendly-message {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
    font-style: italic;
}

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

.date {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 15px;
    text-transform: capitalize;
}

.time-display {
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

.time-main {
    font-size: 64px;
    color: var(--secondary-purple);
    display: inline;
}

.time-seconds {
    font-size: 36px;
    color: var(--tertiary-purple);
    display: inline;
}

.time-ampm {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 10px;
    vertical-align: super;
}

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

.location-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.location-name {
    font-size: 18px;
    font-weight: 500;
    color: var(--white);
    margin-bottom: 5px;
}

.location-coords {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Courier New', monospace;
}

.city-image-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 30px auto 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(154, 115, 179, 0.12);
    box-shadow: 0 18px 60px rgba(90, 42, 130, 0.28);
}

.city-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.image-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    text-align: center;
    display: none;
}

.image-loader.visible {
    display: block;
}

/* Card 2: Weather */
.card-2 {
}

.weather-location {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(154, 115, 179, 0.2);
}

.weather-location p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.weather-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.current-weather {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: center;
}

.temp-display {
    display: flex;
    align-items: center;
    gap: 20px;
}

.current-temp {
    font-size: 72px;
    font-weight: 500;
    color: var(--secondary-purple);
}

.weather-condition {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.weather-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px rgba(154, 115, 179, 0.3));
}

.weather-condition p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: capitalize;
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: var(--glass-bg-light);
    border: 1px solid rgba(154, 115, 179, 0.2);
    border-radius: 12px;
    text-align: center;
}

.detail-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 18px;
    font-weight: 500;
    color: var(--secondary-purple);
}

.forecast-container {
    width: 100%;
}

.forecast-title {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

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

.forecast-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.forecast-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
}

.forecast-temps {
    font-size: 12px;
    color: var(--secondary-purple);
    font-weight: 500;
}

.forecast-desc {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin-top: 6px;
}

/* Ticker Tape */
.ticker-container {
    margin: 40px 0;
    z-index: 10;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    width: 100vw;
    padding: 10px 0;
}

/* Soft fade at the edges so the ticker feels full-bleed */
.ticker-container::before,
.ticker-container::after {
    content: '';
    position: absolute;
    top: 0;
    width: 80px;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}
.ticker-container::before {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.9), rgba(0,0,0,0));
}
.ticker-container::after {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.9), rgba(0,0,0,0));
}

tv-ticker-tape {
    --tv-color-background: transparent !important;
    --tv-color-text: rgba(255, 255, 255, 0.95) !important;
}

/* Hide TradingView branding elements inserted after widget loads */
.ticker-container .tv-branding, .ticker-container .bottom-link, .ticker-container [class*="tv-branding"] {
    display: none !important;
}

/* Card 3: News */
.card-3 {
}

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

.news-card {
    background: var(--glass-bg-light);
    border: 1px solid rgba(154, 115, 179, 0.2);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(90, 42, 130, 0.3);
    border-color: rgba(154, 115, 179, 0.5);
}

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

.news-body {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--white);
    margin-bottom: 8px;
    line-height: 1.4;
    flex: 1;
}

.news-description {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.4;
    margin-bottom: 10px;
    flex: 1;
}

.news-link {
    color: var(--secondary-purple);
    font-size: 11px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.news-link:hover {
    color: var(--white);
}

.news-loading {
    grid-column: 1 / -1;
    padding: 40px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* Card 4: Finance */
.card-4 {
}

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

.finance-section:last-child {
    margin-bottom: 0;
}

.finance-section h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--secondary-purple);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tradingview-widget-container {
    width: 100%;
}

.tradingview-widget-container__widget {
    width: 100%;
}

/* Card 5: Aurora */
.card-5 {
}

.aurora-blurb {
    margin-bottom: 30px;
    line-height: 1.8;
}

.aurora-blurb p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.aurora-graph {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--glass-bg-light);
    border: 1px solid rgba(154, 115, 179, 0.2);
    border-radius: 12px;
}

.aurora-graph h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary-purple);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#kpChart {
    max-height: 300px;
}

.aurora-animation {
    padding: 20px;
    background: var(--glass-bg-light);
    border: 1px solid rgba(154, 115, 179, 0.2);
    border-radius: 12px;
}

.aurora-animation h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary-purple);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.animation-container {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(154, 115, 179, 0.3);
    margin-bottom: 10px;
}

.aurora-image {
    width: 100%;
    height: auto;
    display: block;
}

.animation-note {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* Card 6: Footer */
.card-6 {
    margin-bottom: 20px;
    background: var(--glass-bg);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-contact {
    border-bottom: 1px solid rgba(154, 115, 179, 0.2);
    padding-bottom: 20px;
}

.footer-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.footer-email {
    font-size: 14px;
    color: var(--secondary-purple);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-email:hover {
    color: var(--white);
}

.footer-credit {
    padding: 20px 0;
    border-bottom: 1px solid rgba(154, 115, 179, 0.2);
}

.credit-line {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.tagline {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.footer-info {
    padding-top: 20px;
}

.copyright {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}

.footer-link {
    font-size: 12px;
    color: var(--secondary-purple);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    .card {
        padding: 25px;
        margin-bottom: 25px;
        max-width: 95vw;
    }

    .greeting {
        font-size: 36px;
    }

    .time-main {
        font-size: 48px;
    }

    .time-seconds {
        font-size: 28px;
    }

    .current-temp {
        font-size: 56px;
    }

    .city-image-container {
        width: 250px;
        height: 250px;
    }

    .current-weather {
        gap: 20px;
    }

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

    .forecast-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

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

    .card-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 20px;
    }

    .greeting {
        font-size: 28px;
    }

    .friendly-message {
        font-size: 14px;
    }

    .time-main {
        font-size: 36px;
    }

    .time-seconds {
        font-size: 22px;
    }

    .current-temp {
        font-size: 44px;
    }

    .weather-icon {
        width: 60px;
        height: 60px;
    }

    .city-image-container {
        width: 200px;
        height: 200px;
    }

    .temp-display {
        flex-direction: column;
        gap: 15px;
    }

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

    .detail-item {
        padding: 10px;
    }

    .detail-label {
        font-size: 10px;
    }

    .detail-value {
        font-size: 16px;
    }

    .forecast-grid {
        gap: 8px;
    }

    .forecast-item {
        padding: 10px;
    }

    .forecast-date {
        font-size: 11px;
    }

    .forecast-icon {
        width: 32px;
        height: 32px;
    }

    .forecast-temps {
        font-size: 11px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(20, 10, 30, 0.3);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-purple);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-purple);
}
