/* Brand Colors & Variables */
:root {
    --primary: #4b1463;
    --secondary: #7d3f98;
    --accent: #d395ff;
    --base: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #e0e0e0;
    --shadow: rgba(75, 20, 99, 0.1);
    --gradient: linear-gradient(135deg, #4b1463 0%, #7d3f98 100%);
    
    --border-radius: 12px;
    --card-shadow: 0 4px 20px var(--shadow);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: #fafafa;
    scroll-behavior: smooth;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

/* Cards */
.card {
    background: var(--base);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--shadow);
}

/* Top Header */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--base);
    box-shadow: 0 2px 10px rgba(75, 20, 99, 0.1);
    z-index: 1000;
    height: 60px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.brand-text {
    font-weight: 600;
    color: var(--primary);
    font-size: 1.1rem;
}

.header-cta {
    background: var(--primary);
    color: var(--base);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.header-cta:hover {
    background: var(--secondary);
    transform: translateY(-1px);
}

/* Hero Section */
.hero {
    background: var(--gradient);
    color: var(--base);
    text-align: center;
    padding: 4rem 0 3rem 0;
    margin-top: 60px;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 700;
    color: var(--base);
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-description {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    margin-bottom: 2.5rem;
    opacity: 0.95;
    font-weight: 400;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-content {
    width: 100%;
}

.logo h1 {
    color: var(--base);
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tagline {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    font-weight: 300;
}

.cta-button {
    background: var(--base);
    color: var(--primary);
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2rem;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255,255,255,0.3);
}

.demo-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.demo-toggle, .reset-button {
    background: rgba(255,255,255,0.1);
    color: var(--base);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.demo-toggle:hover, .reset-button:hover {
    background: rgba(255,255,255,0.2);
}

/* Form Styles */
.checkin {
    padding: 4rem 0;
}

.form-group {
    margin-bottom: 2rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text);
}

/* Mood Selector */
.mood-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.mood-option {
    font-size: 2.5rem;
    border: 3px solid transparent;
    border-radius: 50%;
    padding: 0.5rem;
    background: var(--base);
    cursor: pointer;
    transition: var(--transition);
    min-width: 60px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mood-option:hover {
    border-color: var(--accent);
    transform: scale(1.1);
}

.mood-option.selected {
    border-color: var(--primary);
    background: var(--accent);
}

/* Sliders */
.slider-container {
    position: relative;
    padding: 1rem 0;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow);
    transition: var(--transition);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--shadow);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px var(--shadow);
}

.slider-value {
    position: absolute;
    right: 0;
    top: 0;
    font-weight: 600;
    color: var(--primary);
    font-size: 1.1rem;
}

/* Form Inputs */
.number-input, .select-input, .textarea-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.number-input:focus, .select-input:focus, .textarea-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(75, 20, 99, 0.1);
}

.textarea-input {
    resize: vertical;
    min-height: 100px;
}

/* Toggles */
.toggle-container {
    display: flex;
    align-items: center;
}

.toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 50px;
    height: 26px;
    background: var(--border);
    border-radius: 13px;
    position: relative;
    transition: var(--transition);
    margin-right: 1rem;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--base);
    top: 3px;
    left: 3px;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toggle input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-label {
    font-weight: 500;
    color: var(--text);
}

/* Chips */
.chips-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chip {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: 25px;
    background: var(--base);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    min-width: 60px;
}

.chip:hover {
    border-color: var(--accent);
    background: rgba(211, 149, 255, 0.1);
}

.chip.selected {
    border-color: var(--primary);
    background: var(--accent);
    color: var(--primary);
}

/* Submit Button */
.submit-button {
    width: 100%;
    background: var(--gradient);
    color: var(--base);
    border: none;
    padding: 1.2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow);
}

.submit-button:active {
    transform: translateY(0);
}

/* Results Section */
.results {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f8f4ff 0%, #fff 100%);
}

.score-display {
    text-align: center;
    margin-bottom: 3rem;
}

.score-circle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--gradient);
    color: var(--base);
    margin-bottom: 1rem;
    position: relative;
    box-shadow: 0 8px 30px var(--shadow);
}

.score-number {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.score-emoji {
    font-size: 2rem;
    margin-top: 0.5rem;
}

.score-title {
    font-size: 2rem;
    margin-bottom: 0;
    color: var(--primary);
}

/* Breakdown Bars */
.breakdown-bars {
    margin-bottom: 2rem;
}

.breakdown-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.breakdown-label {
    flex: 0 0 120px;
    font-weight: 500;
    color: var(--text);
}

.breakdown-bar-container {
    flex: 1;
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
    margin: 0 1rem;
}

.breakdown-bar {
    height: 100%;
    background: var(--gradient);
    border-radius: 5px;
    transition: width 1s ease-out;
}

.breakdown-value {
    flex: 0 0 30px;
    text-align: right;
    font-weight: 600;
    color: var(--primary);
}

/* Personalized Message */
.personalized-message {
    background: linear-gradient(135deg, rgba(75, 20, 99, 0.05) 0%, rgba(211, 149, 255, 0.05) 100%);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary);
    margin-bottom: 2rem;
}

.personalized-message h3 {
    margin-bottom: 1rem;
}

.personalized-message p {
    line-height: 1.6;
    color: var(--text-light);
}

/* SOS Panel */
.sos-panel {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: var(--base);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    text-align: center;
}

.sos-panel h3 {
    color: var(--base);
    margin-bottom: 1rem;
}

.breathing-widget {
    margin: 1rem 0;
}

.breathe-circle {
    width: 80px;
    height: 80px;
    border: 3px solid var(--base);
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: breathe 4s infinite;
    font-weight: 600;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

.mini-moves {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.move-button {
    background: rgba(255,255,255,0.2);
    color: var(--base);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.move-button:hover {
    background: rgba(255,255,255,0.3);
}

/* Blog Links */
.blog-links {
    margin-bottom: 2rem;
}

.blog-link {
    display: block;
    background: var(--base);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
}

.blog-link:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.blog-link h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.blog-link p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Share Actions */
.share-actions {
    text-align: center;
}

.action-button {
    background: var(--primary);
    color: var(--base);
    border: none;
    padding: 0.75rem 1.5rem;
    margin: 0.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.action-button:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

.social-share {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.social-button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
}

.social-button.linkedin {
    background: #0077b5;
    color: var(--base);
}

.social-button.facebook {
    background: #1877f2;
    color: var(--base);
}

.social-button.twitter {
    background: #1da1f2;
    color: var(--base);
}

.social-button.whatsapp {
    background: #25d366;
    color: var(--base);
}

.social-button.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: var(--base);
}

.social-button.skype {
    background: #00aff0;
    color: var(--base);
}

.social-button.reddit {
    background: #ff4500;
    color: var(--base);
}

.social-button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* History Section */
.history {
    padding: 4rem 0;
}

.streak-info {
    text-align: center;
    margin-bottom: 2rem;
}

.streak-counter {
    display: inline-block;
    margin-bottom: 1rem;
}

.streak-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

.streak-label {
    display: block;
    color: var(--text-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badges {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.badge {
    background: var(--gradient);
    color: var(--base);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge.locked {
    background: var(--border);
    color: var(--text-light);
}

/* Emoji Timeline */
.emoji-timeline {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(75, 20, 99, 0.05);
    border-radius: var(--border-radius);
}

.timeline-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 40px;
}

.timeline-emoji {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.timeline-date {
    font-size: 0.7rem;
    color: var(--text-light);
}

/* Chart */
.chart-container {
    margin-top: 2rem;
}

.chart-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.chart-tab {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    background: var(--base);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.chart-tab.active {
    border-color: var(--primary);
    background: var(--accent);
    color: var(--primary);
}

.chart-tab:hover {
    border-color: var(--accent);
}

#progress-chart {
    max-width: 100%;
    height: 200px !important;
    border-radius: var(--border-radius);
}

/* Footer */
.footer {
    background: var(--primary);
    color: var(--base);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--base);
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: var(--card-shadow);
}

.back-to-top:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

.back-to-top.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--primary);
    color: var(--base);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    z-index: 1001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

.toast-close {
    background: none;
    border: none;
    color: var(--base);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    min-width: 20px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    padding: 2rem;
}

.modal {
    background: var(--base);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal h3 {
    margin-bottom: 1rem;
}

.modal p {
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.modal-button.primary {
    background: var(--primary);
    color: var(--base);
}

.modal-button.secondary {
    background: var(--border);
    color: var(--text);
}

.modal-button:hover {
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .top-header {
        height: 70px;
    }
    
    .header-content {
        height: 70px;
    }
    
    .brand-text {
        font-size: 1rem;
    }
    
    .header-cta {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .hero {
        padding: 3rem 0 2rem 0;
        margin-top: 70px;
        min-height: 50vh;
    }
    
    .hero-title {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }
    
    .hero-description {
        font-size: clamp(1rem, 4vw, 1.1rem);
        margin-bottom: 2rem;
    }
    
    .checkin, .results, .history {
        padding: 2rem 0;
    }
    
    .score-circle {
        width: 150px;
        height: 150px;
    }
    
    .score-number {
        font-size: 2.5rem;
    }
    
    .breakdown-label {
        flex: 0 0 80px;
        font-size: 0.9rem;
    }
    
    .mood-option {
        font-size: 2rem;
        min-width: 50px;
        min-height: 50px;
    }
    
    .demo-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
    
    .toast {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
    
    .chart-tabs {
        flex-wrap: wrap;
    }
    
    .social-share {
        gap: 0.25rem;
        justify-content: center;
    }
    
    .social-button {
        padding: 0.35rem 0.7rem;
        font-size: 0.75rem;
        border-radius: 15px;
    }
}

@media (max-width: 480px) {
    .cta-button {
        width: 100%;
        max-width: 280px;
    }
    
    .mood-selector {
        gap: 0.25rem;
    }
    
    .mood-option {
        font-size: 1.8rem;
        min-width: 45px;
        min-height: 45px;
        padding: 0.25rem;
    }
    
    .chips-container {
        justify-content: center;
    }
    
    .chip {
        flex: 1;
        min-width: 50px;
        max-width: 80px;
        text-align: center;
    }
    
    .breakdown-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .breakdown-label {
        flex: 1 0 100%;
        margin-bottom: 0.5rem;
    }
    
    .breakdown-bar-container {
        flex: 1;
        margin: 0;
    }
    
    .breakdown-value {
        flex: 0 0 auto;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-button {
        width: 100%;
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* Focus States for Accessibility */
*:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --shadow: rgba(0, 0, 0, 0.3);
        --border: #999999;
        --text-light: #444444;
    }
    
    .card {
        border: 1px solid var(--border);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .breathe-circle {
        animation: none;
    }
    
    html {
        scroll-behavior: auto;
    }
}