/* DebtShare - Main Styles */

:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --accent: #e94560;
    --accent-glow: rgba(233, 69, 96, 0.4);
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-dim: rgba(255, 255, 255, 0.4);
    --border: rgba(255, 255, 255, 0.1);
}

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

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.header .logo {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.nav {
    display: flex;
    gap: 0.75rem;
}

.nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 16px;
    transition: all 0.2s;
}

.nav a:hover {
    color: var(--text);
}

.nav a.active {
    background: var(--accent);
    color: var(--text);
}

/* App Container */
.app {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 0 3rem;
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.logo span {
    color: var(--accent);
}

.tagline {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.share-display {
    padding: 2rem;
}

.share-amount {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 40px var(--accent-glow);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    transition: all 0.3s ease;
}

.share-label {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* View Switcher */
.view-switcher {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.view-btn {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 0.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.view-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}

.view-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text);
}

.view-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.view-pop {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Context Cards */
.context-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.card-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.25rem;
}

.card-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Section Title */
.section-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1rem;
}

/* Chart Section */
.chart-section {
    margin-bottom: 2rem;
}

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    height: 200px;
    position: relative;
}

#debtChart {
    width: 100%;
    height: 100%;
}

/* Comparisons */
.comparisons {
    margin-bottom: 2rem;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.comparison-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.comparison-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.comparison-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (min-width: 768px) {
    .comparison-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Share Section */
.share-section {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.share-prompt {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.share-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text);
    transform: scale(1.1);
}

.copy-toast {
    position: absolute;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--accent);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Footer */
.footer {
    margin-top: auto;
    text-align: center;
    padding-top: 2rem;
}

.footer p {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer a:hover {
    color: var(--accent);
}

.update-time {
    font-size: 0.7rem;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.loading .share-amount {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes countUp {
    from { opacity: 0.7; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.share-amount.updating {
    animation: countUp 0.3s ease-out;
}

/* Responsive */
@media (max-width: 480px) {
    .app {
        padding: 1.5rem 1rem;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .share-amount {
        font-size: 2.5rem;
    }
    
    .view-btn {
        padding: 0.75rem 0.25rem;
    }
    
    .view-title {
        font-size: 0.65rem;
    }
    
    .context-cards {
        gap: 0.5rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .card-value {
        font-size: 1rem;
    }
}

@media (min-width: 768px) {
    .share-amount {
        font-size: 4.5rem;
    }
    
    .context-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}
