/* ============================================
   Consciousness 7 - Main Stylesheet
   ============================================ */

:root {
    /* Brand Colors - Play Life Inspired */
    --primary-color: #4A90E2;
    --primary-dark: #2E5C8A;
    --primary-light: #6BADF5;
    
    /* Level Colors */
    --level-1-color: #E63946; /* Survival - Red */
    --level-2-color: #F77F00; /* Ego - Orange */
    --level-3-color: #FCBF49; /* Meaning - Yellow */
    --level-4-color: #06A77D; /* Mission - Green */
    --level-5-color: #4895EF; /* Philosophy - Blue */
    --level-6-color: #7209B7; /* Transcendence - Purple */
    --level-7-color: #F72585; /* Creator - Magenta */
    
    /* Neutral Colors - Dark Theme */
    --bg-color: #0A1628;
    --surface-color: #1A2942;
    --text-primary: #E8EDF5;
    --text-secondary: #A0B0C8;
    --text-tertiary: #6B7A92;
    --border-color: #2A3F5F;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    /* Spacing */
    --header-height: 60px;
    --bottom-nav-height: 70px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Typography */
    --font-primary: 'Noto Sans KR', sans-serif;
    --font-secondary: 'Inter', sans-serif;
}

/* ============================================
   Global Styles
   ============================================ */

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

body {
    font-family: var(--font-primary);
    background: linear-gradient(180deg, #0A1628 0%, #1A2942 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

/* ============================================
   Header
   ============================================ */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(26, 41, 66, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(74, 144, 226, 0.3);
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--spacing-md);
    max-width: 1200px;
    margin: 0 auto;
}

.app-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4A90E2, #6BADF5, #A0D8FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(74, 144, 226, 0.3);
}

.profile-icon, .donate-icon {
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-icon:hover, .donate-icon:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.donate-icon {
    color: #FFD700;
    animation: gentle-glow 3s ease-in-out infinite;
}

@keyframes gentle-glow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    }
    50% {
        text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    }
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    padding-top: var(--header-height);
    padding-bottom: var(--bottom-nav-height);
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
}

.view {
    display: none;
    padding: var(--spacing-md);
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

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

/* ============================================
   Sections
   ============================================ */

section {
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subsection-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
}

/* ============================================
   Current Level Display
   ============================================ */

.current-level-section {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.3), rgba(46, 92, 138, 0.3));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(74, 144, 226, 0.4);
    border-radius: 20px;
    padding: var(--spacing-lg);
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 60px rgba(74, 144, 226, 0.2);
}

.level-display {
    text-align: center;
}

.level-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.level-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.level-description {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* ============================================
   Ring Chart & Charts
   ============================================ */

.level-progress-section {
    background: rgba(26, 41, 66, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 16px;
    padding: var(--spacing-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.level-progress-container {
    position: relative;
    padding: 3rem 0 2rem 0;
}

.level-progress-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 2rem;
    position: relative;
}

.level-segment {
    flex: 1;
    position: relative;
    height: 60px;
    background: rgba(10, 22, 40, 0.5);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.level-segment:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.segment-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    transition: height 0.6s ease;
    opacity: 0.3;
}

.level-segment.active .segment-fill {
    height: 100%;
    opacity: 0.6;
}

.level-segment.completed .segment-fill {
    height: 100%;
    opacity: 0.8;
}

.level-segment[data-level="1"] .segment-fill {
    background: linear-gradient(to top, var(--level-1-color), rgba(230, 57, 70, 0.3));
}

.level-segment[data-level="2"] .segment-fill {
    background: linear-gradient(to top, var(--level-2-color), rgba(247, 127, 0, 0.3));
}

.level-segment[data-level="3"] .segment-fill {
    background: linear-gradient(to top, var(--level-3-color), rgba(252, 191, 73, 0.3));
}

.level-segment[data-level="4"] .segment-fill {
    background: linear-gradient(to top, var(--level-4-color), rgba(6, 167, 125, 0.3));
}

.level-segment[data-level="5"] .segment-fill {
    background: linear-gradient(to top, var(--level-5-color), rgba(72, 149, 239, 0.3));
}

.level-segment[data-level="6"] .segment-fill {
    background: linear-gradient(to top, var(--level-6-color), rgba(114, 9, 183, 0.3));
}

.level-segment[data-level="7"] .segment-fill {
    background: linear-gradient(to top, var(--level-7-color), rgba(247, 37, 133, 0.3));
}

.segment-label {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-primary);
    font-weight: 600;
}

.segment-number {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.segment-name {
    font-size: 0.75rem;
    opacity: 0.8;
}

.level-segment.active .segment-label {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.level-indicator {
    position: absolute;
    top: -0.5rem;
    left: 0;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
}

.level-indicator.visible {
    opacity: 1;
}

.indicator-arrow {
    font-size: 2.5rem;
    color: #FFD700;
    line-height: 1;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8),
                 0 0 20px rgba(255, 215, 0, 0.6),
                 0 0 30px rgba(255, 215, 0, 0.4);
    animation: bounce 2s ease-in-out infinite;
}

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

.indicator-label {
    display: none; /* Hide "YOU ARE HERE" text */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .level-progress-container {
        padding: 2.5rem 0 1.5rem 0;
    }
    
    .level-progress-bar {
        gap: 2px;
    }
    
    .level-segment {
        height: 50px;
    }
    
    .segment-number {
        font-size: 1.2rem;
    }
    
    .segment-name {
        font-size: 0.65rem;
    }
    
    .level-indicator {
        top: 0.5rem;
    }
    
    .indicator-arrow {
        font-size: 2rem;
    }
    
    .indicator-label {
        font-size: 0.6rem;
        padding: 0.2rem 0.5rem;
        letter-spacing: 1px;
    }
}

.chart-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

/* ============================================
   Today's Guidance
   ============================================ */

.todays-guidance {
    background: rgba(26, 41, 66, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 16px;
    padding: var(--spacing-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.guidance-card {
    margin-top: var(--spacing-sm);
}

.guidance-item {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    background: rgba(10, 22, 40, 0.5);
    border: 1px solid rgba(74, 144, 226, 0.15);
    border-radius: 12px;
}

.guidance-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.guidance-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.guidance-content ul {
    list-style: none;
    padding: 0;
}

.guidance-content li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    padding-left: 1rem;
    position: relative;
}

.guidance-content li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* ============================================
   Tracking Section
   ============================================ */

.tracking-section {
    background: rgba(26, 41, 66, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 16px;
    padding: var(--spacing-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Level Navigation Grid
   ============================================ */

.level-navigation {
    background: rgba(26, 41, 66, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 16px;
    padding: var(--spacing-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-sm);
}

.level-card {
    background: rgba(10, 22, 40, 0.4);
    border: 2px solid rgba(74, 144, 226, 0.2);
    border-radius: 12px;
    padding: var(--spacing-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.level-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(74, 144, 226, 0.3);
    border-color: rgba(74, 144, 226, 0.5);
    background: rgba(10, 22, 40, 0.6);
}

.level-card.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.3), 0 0 20px rgba(74, 144, 226, 0.4);
    background: rgba(74, 144, 226, 0.15);
}

.level-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto var(--spacing-xs);
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.6);
}

.level-card[data-level="1"] .level-badge {
    background: linear-gradient(135deg, var(--level-1-color), #FF6B6B);
}

.level-card[data-level="2"] .level-badge {
    background: linear-gradient(135deg, var(--level-2-color), #FFB347);
}

.level-card[data-level="3"] .level-badge {
    background: linear-gradient(135deg, var(--level-3-color), #FFD700);
}

.level-card[data-level="4"] .level-badge {
    background: linear-gradient(135deg, var(--level-4-color), #10D07A);
}

.level-card[data-level="5"] .level-badge {
    background: linear-gradient(135deg, var(--level-5-color), #66B2FF);
}

.level-card[data-level="6"] .level-badge {
    background: linear-gradient(135deg, var(--level-6-color), #9D4EDD);
}

.level-card[data-level="7"] .level-badge {
    background: linear-gradient(135deg, var(--level-7-color), #FF006E);
}

.level-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.level-card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-secondary);
}

/* ============================================
   Buttons
   ============================================ */

.btn-primary, .btn-secondary {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: var(--spacing-sm);
}

.btn-primary {
    background: linear-gradient(135deg, #4A90E2, #2E5C8A);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
    border: 1px solid rgba(74, 144, 226, 0.5);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(74, 144, 226, 0.6);
    background: linear-gradient(135deg, #5AA0F2, #3E6C9A);
}

.btn-secondary {
    background: rgba(10, 22, 40, 0.5);
    color: var(--text-primary);
    border: 2px solid rgba(74, 144, 226, 0.3);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(26, 41, 66, 0.8);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

/* ============================================
   Bottom Navigation
   ============================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(26, 41, 66, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(74, 144, 226, 0.3);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex: 1;
    height: 100%;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item i {
    font-size: 1.3rem;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 0 0 3px 3px;
}

.nav-item-add {
    position: relative;
}

.nav-item-add i {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    margin-bottom: 0.5rem;
}

/* ============================================
   Modal Styles
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

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

.modal-container {
    background: rgba(26, 41, 66, 0.95);
    backdrop-filter: blur(30px);
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 24px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 40px rgba(74, 144, 226, 0.15);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
    background: rgba(74, 144, 226, 0.1);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem 1.5rem;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
    color: var(--text-secondary);
    line-height: 1.8;
}

.modal-body h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body h3::before {
    content: '◆';
    color: var(--primary-color);
    font-size: 1rem;
}

.modal-body ul {
    list-style: none;
    padding-left: 0;
    margin: 1rem 0;
}

.modal-body ul li {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.modal-body ul li::before {
    content: '•';
    position: absolute;
    left: 0.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

.modal-body .modal-section {
    background: rgba(74, 144, 226, 0.05);
    border-left: 3px solid var(--primary-color);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 12px 12px 0;
}

.modal-body .modal-quote {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-color);
    font-style: italic;
    text-align: center;
    padding: 1.5rem;
    margin: 2rem 0;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Donate Button */
.donate-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #0A1628;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 215, 0, 0.5);
}

.donate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.6);
    background: linear-gradient(135deg, #FFA500 0%, #FFD700 100%);
}

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

.donate-button i {
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(1.1);
    }
    20%, 40% {
        transform: scale(1);
    }
}

/* ============================================
   Home Footer
   ============================================ */

.home-footer {
    margin-top: 3rem;
    padding: 2rem 0 1rem 0;
    text-align: center;
    border-top: 1px solid rgba(74, 144, 226, 0.2);
}

.version-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-bottom: 0.5rem;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
}

.company-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.8;
    font-weight: 500;
    letter-spacing: 1px;
}

.company-info:hover {
    color: var(--primary-color);
    opacity: 1;
    transition: all 0.3s ease;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .level-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-container {
        padding: 0 var(--spacing-sm);
    }
    
    .view {
        padding: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .level-number {
        font-size: 2.5rem;
    }
    
    .level-name {
        font-size: 1.25rem;
    }
    
    .nav-item span {
        font-size: 0.65rem;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

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

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.hidden {
    display: none !important;
}

.loading {
    opacity: 0.5;
    pointer-events: none;
}
