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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #98D8E8 25%, #A9E2F3 50%, #BAECFE 75%, #CBF6FF 100%);
    min-height: 100vh;
    color: #2c3e50;
    line-height: 1.6;
    padding-bottom: 80px;
}

/* Paper Texture Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
}

/* Header */
.app-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.app-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.app-header p {
    color: #5a6c7d;
    font-size: 0.9rem;
}

/* Main Content */
.app-main {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Sections */
.app-section {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.app-section.active {
    display: block;
}

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

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.6rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: #5a6c7d;
    font-size: 0.95rem;
}

/* Welcome Card */
.welcome-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.welcome-card h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.welcome-card p {
    color: #5a6c7d;
    font-size: 1rem;
    line-height: 1.6;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tool-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.tool-card:active {
    transform: translateY(-2px);
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tool-card h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.tool-card p {
    color: #5a6c7d;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #2c3e50;
}

.btn-danger {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #2c3e50;
}

/* Breathing Section */
.breathing-container {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.breathing-circle {
    width: 200px;
    height: 200px;
    border: 3px solid #667eea;
    border-radius: 50%;
    margin: 2rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.breathing-circle.inhale {
    transform: scale(1.3);
    background: rgba(102, 126, 234, 0.1);
}

.breathing-circle.exhale {
    transform: scale(0.8);
    background: rgba(118, 75, 162, 0.1);
}

.breathing-circle.hold {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.95);
}

.breathing-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.breathing-controls {
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.breathing-options {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 15px;
    margin-top: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.breathing-options label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.breathing-options select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    color: #2c3e50;
}

/* Grounding Section */
.grounding-container {
    max-width: 600px;
    margin: 0 auto;
}

.grounding-progress {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e1e8ed;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    color: #5a6c7d;
    font-size: 0.9rem;
    font-weight: 500;
}

.grounding-step {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.step-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.grounding-step h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.grounding-step p {
    color: #5a6c7d;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.step-input textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 1rem;
}

.step-input textarea:focus {
    outline: none;
    border-color: #667eea;
}

.grounding-controls {
    text-align: center;
    margin-bottom: 2rem;
}

.grounding-summary {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.grounding-summary h3 {
    color: #27ae60;
    margin-bottom: 1rem;
}

.summary-content {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    text-align: left;
}

.summary-content div {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

/* Mood Tracker Section */
.mood-container {
    max-width: 800px;
    margin: 0 auto;
}

.mood-input-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.mood-input-card h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

.mood-scale {
    margin-bottom: 2rem;
}

.mood-scale label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 500;
    color: #2c3e50;
}

.scale-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.scale-container input[type="range"] {
    flex: 1;
    height: 8px;
    background: #e1e8ed;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.scale-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

.scale-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#anxietyValue {
    font-weight: 600;
    color: #667eea;
    font-size: 1.2rem;
    min-width: 30px;
    text-align: center;
}

.mood-emotions {
    margin-bottom: 2rem;
}

.mood-emotions label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 500;
    color: #2c3e50;
}

.emotion-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.emotion-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #e1e8ed;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.emotion-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.emotion-btn.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.mood-triggers,
.mood-notes {
    margin-bottom: 2rem;
}

.mood-triggers label,
.mood-notes label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.mood-triggers textarea,
.mood-notes textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

.mood-triggers textarea:focus,
.mood-notes textarea:focus {
    outline: none;
    border-color: #667eea;
}

.mood-history {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.mood-history h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

.mood-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #e1e8ed;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.mood-chart {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-data {
    color: #5a6c7d;
    font-style: italic;
    text-align: center;
}

.mood-entries {
    max-height: 400px;
    overflow-y: auto;
}

.mood-entry {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1rem;
    border-left: 4px solid #667eea;
}

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

.mood-entry-date {
    font-weight: 600;
    color: #2c3e50;
}

.mood-entry-level {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
}

.mood-entry-emotions {
    margin-bottom: 0.5rem;
}

.mood-entry-emotions span {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

.mood-entry-text {
    color: #5a6c7d;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Quick Relief Section */
.relief-container {
    max-width: 800px;
    margin: 0 auto;
}

.emergency-notice {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.notice-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.emergency-notice h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.emergency-notice p {
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

.emergency-contacts {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.emergency-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.emergency-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.relief-techniques {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.technique-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.technique-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.technique-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.technique-card h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.technique-card p {
    color: #5a6c7d;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.try-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.try-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.technique-detail {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    position: relative;
}

.close-detail {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #5a6c7d;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-detail:hover {
    background: rgba(0,0,0,0.1);
}

/* Resources Section */
.resources-container {
    max-width: 800px;
    margin: 0 auto;
}

.resource-category {
    margin-bottom: 2rem;
}

.resource-category h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.resource-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.resource-item {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.resource-info h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.resource-info p {
    color: #5a6c7d;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.resource-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.resource-contact span {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

.resource-contact a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.resource-contact a:hover {
    color: #764ba2;
}

/* FAQ Section */
.faq-section {
    margin: 3rem auto 2rem;
    max-width: 800px;
}

.faq-section h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 1.6rem;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #2c3e50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background: rgba(102, 126, 234, 0.05);
}

.faq-icon {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    color: #5a6c7d;
    line-height: 1.6;
    animation: slideDown 0.3s ease;
}

.faq-answer[hidden] {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.1);
    border-top: 1px solid rgba(255,255,255,0.2);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #5a6c7d;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 10px;
    min-width: 60px;
}

.nav-item:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.nav-item.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.15);
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

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

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    text-align: center;
    padding: 1rem;
    color: #5a6c7d;
    font-size: 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-main {
        padding: 0.5rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    .welcome-card {
        padding: 1.5rem;
    }
    
    .emergency-contacts {
        flex-direction: column;
    }
    
    .resource-contact {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .mood-filters {
        flex-wrap: wrap;
    }
    
    .emotion-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .relief-techniques {
        grid-template-columns: 1fr;
    }
    
    .breathing-circle {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 480px) {
    .app-header h1 {
        font-size: 1.5rem;
    }
    
    .tool-card {
        padding: 1rem;
    }
    
    .tool-icon {
        font-size: 2.5rem;
    }
    
    .breathing-circle {
        width: 120px;
        height: 120px;
    }
    
    .breathing-text {
        font-size: 1rem;
    }
    
    .technique-icon {
        font-size: 2.5rem;
    }
    
    .nav-item i {
        font-size: 1rem;
    }
    
    .nav-item span {
        font-size: 0.65rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .breathing-circle {
        transition: none !important;
    }
}

/* Focus States */
button:focus,
select:focus,
textarea:focus,
input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.nav-item:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 10px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .tool-card,
    .welcome-card,
    .breathing-options,
    .grounding-step,
    .mood-input-card,
    .resource-item,
    .faq-item {
        border: 2px solid #2c3e50;
    }
    
    .btn {
        border: 2px solid #2c3e50;
    }
}
