/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --purple-dark: #4a1a62;
    --purple-medium: #5a2a82;
    --purple-light: #7a5a92;
    --purple-lighter: #9a73b3;
    --glass-bg: rgba(20, 10, 30, 0.6);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-tertiary: rgba(255, 255, 255, 0.6);
}

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

/* Abstract Background */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #000000;
    overflow: hidden;
}

.background::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(
        circle at 20% 30%,
        rgba(90, 42, 130, 0.08) 0%,
        transparent 50%
    ),
    radial-gradient(
        circle at 80% 70%,
        rgba(154, 115, 179, 0.05) 0%,
        transparent 50%
    ),
    radial-gradient(
        circle at 50% 50%,
        rgba(122, 90, 146, 0.04) 0%,
        transparent 60%
    );
    animation: backgroundFloat 20s ease-in-out infinite;
}

.background::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(90, 42, 130, 0.01) 2px,
            rgba(90, 42, 130, 0.01) 4px
        );
    animation: backgroundShift 15s linear infinite;
}

@keyframes backgroundFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

@keyframes backgroundShift {
    0% { transform: translateY(0); }
    100% { transform: translateY(20px); }
}

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

/* Glassmorphism Cards */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid transparent;
    box-shadow: 
        0 8px 32px rgba(90, 42, 130, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    padding: 40px;
    margin-bottom: 40px;
    width: 90%;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    position: relative;
    isolation: isolate;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(
        135deg,
        var(--purple-medium) 0%,
        var(--purple-lighter) 50%,
        var(--purple-light) 100%
    );
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: -1;
}

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

.card-content {
    width: 100%;
}

.card h2 {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 30px;
    text-align: center;
    color: var(--text-primary);
}

.card h3 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

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

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

.greeting-message {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

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

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

.time-display {
    font-size: 4rem;
    font-weight: 300;
    margin-bottom: 20px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
}

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

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

.time-ampm {
    font-size: 1.5rem;
    color: var(--text-tertiary);
    margin-left: 10px;
}

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

.location-name {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.coordinates {
    font-size: 1rem;
    color: var(--text-tertiary);
}

.city-image-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(154, 115, 179, 0.3);
    box-shadow: 0 8px 32px rgba(90, 42, 130, 0.4);
}

.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%);
    color: var(--text-secondary);
    font-size: 1rem;
}

.city-image.loaded + .image-loading {
    display: none;
}

/* Card 2: Weather */
.weather-location {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.weather-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

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

.weather-icon-container {
    margin-bottom: 20px;
}

.weather-icon {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 4px 8px rgba(90, 42, 130, 0.5));
}

.temperature-main {
    font-size: 4rem;
    font-weight: 300;
    margin-bottom: 10px;
}

.weather-condition {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.feels-like {
    font-size: 1rem;
    color: var(--text-tertiary);
    margin-bottom: 30px;
}

.weather-details {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.detail-label {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.detail-value {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 500;
}

.forecast-container {
    padding: 20px;
    background: rgba(20, 10, 30, 0.4);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.forecast-container h3 {
    text-align: center;
    margin-bottom: 20px;
}

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

.forecast-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: rgba(90, 42, 130, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(154, 115, 179, 0.2);
    gap: 15px;
}

.forecast-day {
    font-weight: 500;
    min-width: 80px;
}

.forecast-icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.forecast-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex: 1;
}

.forecast-condition {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
}

.forecast-temps {
    display: flex;
    gap: 15px;
    align-items: center;
}

.forecast-high {
    font-size: 1.2rem;
    font-weight: 500;
}

.forecast-low {
    font-size: 1rem;
    color: var(--text-tertiary);
}

/* Ticker Tape */
.ticker-container {
    width: 100%;
    margin: 40px 0;
    padding: 20px 0;
    position: relative;
    overflow: hidden;
}

.ticker-container::before,
.ticker-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 200px;
    z-index: 10;
    pointer-events: none;
}

.ticker-container::before {
    left: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
}

.ticker-container::after {
    right: 0;
    background: linear-gradient(to left, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
}

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

/* Remove TradingView branding */
tv-branding,
.bottom-link {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

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

.news-item {
    background: rgba(20, 10, 30, 0.4);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(154, 115, 179, 0.2);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(90, 42, 130, 0.4);
}

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

.news-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

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

/* Card 4: Financial */
.financial-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.widget-container h3 {
    margin-bottom: 20px;
    text-align: center;
}

.tradingview-widget-container {
    border-radius: 16px;
    overflow: hidden;
    background: rgba(20, 10, 30, 0.3);
    padding: 10px;
}

/* Card 5: Aurora */
.aurora-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.aurora-education {
    background: rgba(20, 10, 30, 0.4);
    padding: 25px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(154, 115, 179, 0.2);
}

.aurora-education p {
    margin-bottom: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.aurora-education p:last-child {
    margin-bottom: 0;
}

.aurora-data {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    position: relative;
    overflow: visible;
}

.kp-graph-container,
.aurora-animation-container {
    background: rgba(20, 10, 30, 0.4);
    padding: 25px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(154, 115, 179, 0.2);
    position: relative;
    overflow: hidden;
}

.kp-graph-container h3,
.aurora-animation-container h3 {
    text-align: center;
    margin-bottom: 20px;
}

.kp-graph-container {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
}

#kp-chart {
    width: 100% !important;
    height: auto !important;
    max-height: 350px !important;
    position: relative !important;
}

.aurora-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(154, 115, 179, 0.3);
}

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

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

.aurora-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
}

.aurora-image.loaded + .aurora-loading {
    display: none;
}

/* Card 6: Footer */
.card-6 {
    width: 90%;
    max-width: 90%;
}

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

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

.contact-email {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 500;
}

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

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

.copyright {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.footer-link a {
    color: var(--purple-lighter);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link a:hover {
    color: var(--purple-light);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .card {
        width: 95%;
        max-width: 95%;
    }
    
    .ticker-container {
        width: 95%;
        max-width: 95%;
    }
    
    .weather-main {
        grid-template-columns: 1fr;
    }
    
    .financial-widgets {
        grid-template-columns: 1fr;
    }
    
    .aurora-data {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .card {
        width: 95%;
        max-width: 95%;
        padding: 25px;
    }
    
    .ticker-container {
        max-width: 95%;
    }
    
    .card-6 {
        max-width: 95%;
    }
    
    .greeting {
        font-size: 2rem;
    }
    
    .time-display {
        font-size: 3rem;
    }
    
    .time-main {
        font-size: 3rem;
    }
    
    .time-seconds {
        font-size: 2rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .temperature-main {
        font-size: 3rem;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

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

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

.loader {
    color: #fff;
    font-family: Consolas, Menlo, Monaco, monospace;
    font-weight: bold;
    font-size: 78px;
    opacity: 0.8;
}

.loader:before {
    content: "{";
    display: inline-block;
    animation: pulse 0.4s alternate infinite ease-in-out;
}

.loader:after {
    content: "}";
    display: inline-block;
    animation: pulse 0.4s 0.3s alternate infinite ease-in-out;
}

@keyframes pulse {
    to {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

