/* The Musical Webb - Referral Program Styles */
/* Updated with accessibility & UX improvements */

:root {
    --purple-primary: #667eea;
    --purple-dark: #764ba2;
    --gold-accent: #ffd700;
    --bg-dark: #1a1a2e;
    --bg-card: #16213e;
    --text-light: #e0e0e0;
    --text-muted: #bbb;  /* Improved contrast */
}

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.bg-purple {
    background: linear-gradient(135deg, var(--purple-primary) 0%, var(--purple-dark) 100%) !important;
}

.navbar-brand {
    font-size: 1.4rem;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 15px;
}

.card-header {
    background: linear-gradient(135deg, var(--purple-primary) 0%, var(--purple-dark) 100%);
    border-bottom: none;
    border-radius: 15px 15px 0 0 !important;
}

/* Button Styles with enhanced visibility */
.btn-primary {
    background: linear-gradient(135deg, var(--purple-primary) 0%, var(--purple-dark) 100%);
    border: none;
    padding: 12px 30px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #7b8eef 0%, #8a5db5 100%);
}

.btn-gold, .btn-accent {
    background: linear-gradient(135deg, var(--gold-accent) 0%, #ffaa00 100%);
    color: #1a1a2e;
    border: none;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-gold:hover, .btn-accent:hover {
    background: linear-gradient(135deg, #ffe44d 0%, #ffbb33 100%);
    color: #1a1a2e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

/* Focus styles for accessibility */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--gold-accent);
    outline-offset: 2px;
}

a:focus-visible {
    outline: 2px solid var(--gold-accent);
    outline-offset: 2px;
    border-radius: 3px;
}

/* Form styles with improved contrast */
.form-control, .form-select {
    background-color: #0f0f1a;
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: var(--text-light);
    padding: 12px 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    background-color: #0f0f1a;
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
    color: var(--text-light);
}

.form-control::placeholder {
    color: #888;  /* Improved from #666 */
}

.form-label {
    color: var(--gold-accent);
    font-weight: 500;
}

.text-gold {
    color: var(--gold-accent) !important;
}

.text-purple {
    color: var(--purple-primary) !important;
}

/* Hero section with improved contrast */
.hero-section {
    text-align: center;
    padding: 40px 0;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section .lead {
    font-size: 1.2rem;
    color: #ccc;  /* Improved from #aaa */
}

/* Referral display */
.referral-id-display {
    background: linear-gradient(135deg, var(--bg-card) 0%, #1e2a4a 100%);
    border: 2px dashed var(--gold-accent);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.referral-id-display .ref-id {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold-accent);
    letter-spacing: 3px;
    font-family: monospace;
}

/* Points display */
.points-display {
    background: linear-gradient(135deg, var(--purple-primary) 0%, var(--purple-dark) 100%);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
}

.points-display .points-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--gold-accent);
}

.points-display .points-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);  /* Improved contrast */
}

/* Table styles */
.table {
    color: var(--text-light);
}

.table thead th {
    background-color: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
    color: var(--gold-accent);
}

.table tbody td {
    border-color: rgba(102, 126, 234, 0.1);
}

/* Alerts */
.alert-success {
    background-color: rgba(25, 135, 84, 0.2);
    border-color: rgba(25, 135, 84, 0.5);
    color: #75d4a0;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.5);
    color: #f1919a;
}

.spinner-border {
    width: 1.2rem;
    height: 1.2rem;
}

/* Landing page specific */
.landing-hero {
    padding: 60px 0;
    text-align: center;
}

.landing-hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.feature-icon {
    font-size: 3rem;
    color: var(--purple-primary);
    margin-bottom: 1rem;
}

.feature-box {
    padding: 30px;
    text-align: center;
}

/* Admin styles */
.admin-sidebar {
    background-color: var(--bg-card);
    min-height: calc(100vh - 56px);
    padding: 20px 0;
}

.admin-sidebar .nav-link {
    color: var(--text-light);
    padding: 12px 20px;
    border-radius: 0;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: rgba(102, 126, 234, 0.2);
    color: var(--gold-accent);
}

/* Stat cards with improved label contrast */
.stat-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, #1e2a4a 100%);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gold-accent);
}

.stat-card .stat-label {
    color: #aaa;  /* Improved from #888 */
    font-size: 0.9rem;
}

/* ========================================
   ANIMATIONS
   ======================================== */

/* Hero fade-in animation */
.hero h1,
.landing-hero h1 {
    animation: fadeInUp 0.6s ease-out;
}

.hero .lead,
.landing-hero .lead {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero .btn,
.landing-hero .btn {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

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

/* Feature card stagger animation */
.feature-card {
    animation: fadeInUp 0.5s ease-out both;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }

/* Pricing card animations */
.pricing-card {
    animation: fadeInUp 0.5s ease-out both;
}

.pricing-card:nth-child(1) { animation-delay: 0.1s; }
.pricing-card:nth-child(2) { animation-delay: 0.2s; }
.pricing-card:nth-child(3) { animation-delay: 0.3s; }
.pricing-card:nth-child(4) { animation-delay: 0.4s; }

/* Loading button state */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin-left: -0.5rem;
    margin-top: -0.5rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner 0.6s linear infinite;
}

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

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background-color: var(--bg-card);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 10px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scroll to top button */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple-primary) 0%, var(--purple-dark) 100%);
    color: white;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Large tablets and small desktops */
@media (max-width: 992px) {
    .hero {
        padding: 60px 0;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .cta-section {
        padding: 50px 0;
    }

    .pricing-card.featured {
        transform: scale(1.02);
    }
}

/* Tablets */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }

    .landing-hero h1,
    .hero h1 {
        font-size: 2rem;
    }

    .hero .lead,
    .landing-hero .lead {
        font-size: 1.1rem;
    }

    .referral-id-display .ref-id {
        font-size: 1.4rem;
        letter-spacing: 1px;
    }

    .points-display .points-value {
        font-size: 2rem;
    }

    .stat-card .stat-value {
        font-size: 2rem;
    }

    .pricing-card.featured {
        transform: scale(1);
    }

    .feature-card {
        margin-bottom: 1rem;
    }

    .btn-lg {
        padding: 10px 24px;
        font-size: 1rem;
    }
}

/* Mobile phones */
@media (max-width: 576px) {
    .hero {
        padding: 40px 0;
    }

    .hero h1,
    .landing-hero h1 {
        font-size: 1.75rem;
    }

    .hero .lead,
    .landing-hero .lead {
        font-size: 1rem;
    }

    /* Stack buttons on mobile */
    .hero .d-flex.gap-3,
    .landing-hero .d-flex.gap-3 {
        flex-direction: column;
        gap: 0.75rem !important;
    }

    .hero .btn,
    .landing-hero .btn {
        width: 100%;
    }

    .btn-lg {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .pricing-card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    /* Scroll top button smaller on mobile */
    .scroll-top-btn {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }

    /* Hide some elements on very small screens */
    .d-none-xs {
        display: none !important;
    }
}

/* Very small phones */
@media (max-width: 375px) {
    .hero h1,
    .landing-hero h1 {
        font-size: 1.5rem;
    }

    .referral-id-display .ref-id {
        font-size: 1.2rem;
        letter-spacing: 0;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card .stat-value {
        font-size: 1.75rem;
    }
}

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

/* Improved text contrast helpers */
.text-muted {
    color: var(--text-muted) !important;
}

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

/* Selection color */
::selection {
    background-color: var(--purple-primary);
    color: white;
}

/* Skip to content for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--gold-accent);
    color: var(--bg-dark);
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}
