/* SelfMe Custom Styles */

/* SelfMe Color Variables */
:root {
    --selfme-mint: #6AE0C2;
    --selfme-yellow: #FFD76A;
    --selfme-black: #1F1F1F;
    --selfme-gray: #3B3B3B;
    --selfme-white: #FFFFFF;
    --selfme-turquoise: #2CB8A5;
    
    /* Override Bootstrap Variables */
    --bs-primary: var(--selfme-mint);
    --bs-secondary: var(--selfme-gray);
    --bs-success: var(--selfme-turquoise);
    --bs-info: var(--selfme-yellow);
    --bs-dark: var(--selfme-black);
    
    /* Font Family */
    --bs-body-font-family: 'Nunito', 'Quicksand', 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Add padding to account for fixed navbar */
body {
    padding-top: 70px;
    font-family: var(--bs-body-font-family);
    background-color: var(--selfme-gray);
    color: var(--selfme-white);
}

/* Rounded corners everywhere */
.card, .btn, .form-control, .alert, .modal-content, .badge, .nav-tabs, .dropdown-menu {
    border-radius: 1rem !important;
}

/* Primary button styling */
.btn-primary {
    background-color: var(--selfme-mint);
    border-color: var(--selfme-mint);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--selfme-turquoise) !important;
    border-color: var(--selfme-turquoise) !important;
}

/* Secondary button styling */
.btn-info {
    background-color: var(--selfme-yellow);
    border-color: var(--selfme-yellow);
    color: var(--selfme-black);
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active {
    background-color: #E5C160 !important;
    border-color: #E5C160 !important;
    color: var(--selfme-black) !important;
}

/* Emergency button fixed at bottom right */
.btn-emergency {
    position: fixed;
    bottom: 70px;
    right: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.4);
    animation: pulse 2s infinite;
}

.btn-emergency:hover, 
.btn-emergency:focus {
    background-color: #bb2d3b !important;
    border-color: #bb2d3b !important;
    color: white !important;
    animation: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Card hover effects */
.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(106, 224, 194, 0.3);
    transition: all 0.3s ease;
}

/* Custom card styling for dashboard */
.feature-card {
    height: 100%;
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    background-color: var(--selfme-black);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.feature-card .card-img-top {
    height: 160px;
    object-fit: cover;
}

.feature-card .card-body {
    padding: 1.5rem;
}

.feature-card .card-title {
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Quote styling */
.quote {
    font-style: italic;
    position: relative;
    padding: 1.5rem;
    margin: 1.5rem 0;
    background-color: rgba(108, 117, 125, 0.1);
    border-left: 4px solid var(--bs-primary);
    border-radius: 0.25rem;
}

.quote:before {
    content: '"';
    font-size: 3rem;
    position: absolute;
    left: 10px;
    top: -10px;
    opacity: 0.3;
}

/* Custom badge for oracle categories */
.badge-category {
    font-size: 0.8rem;
    padding: 0.35em 0.65em;
    border-radius: 50rem;
}

/* Journal entry card styling */
.journal-card {
    margin-bottom: 1.5rem;
    background-color: var(--selfme-black);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.journal-card:hover {
    box-shadow: 0 8px 16px rgba(106, 224, 194, 0.2);
}

.journal-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(106, 224, 194, 0.1);
    border-bottom: none;
    color: var(--selfme-mint);
}

.journal-card .card-text {
    white-space: pre-wrap;
}

/* Journal page specific styles */
.page-title, h1, h2, h3, h4, h5, h6 {
    color: var(--selfme-white);
}

.accordion-button {
    color: var(--selfme-white) !important;
}

.accordion-button::after {
    filter: invert(1);
}

/* Selfer affirmation styling */
.selfer-card {
    border-left: 4px solid var(--selfme-mint);
    background-color: var(--selfme-black);
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.selfer-card:hover {
    box-shadow: 0 8px 16px rgba(255, 215, 106, 0.2);
    transform: translateY(-2px);
}

.selfer-card .card-body {
    padding: 1.5rem;
    position: relative;
}

.selfer-card .card-text {
    font-size: 1.1rem;
    font-style: italic;
    line-height: 1.6;
}

/* Emergency page styling */
.emergency-section {
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 1rem;
    background-color: var(--selfme-black);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.breathing-circle {
    width: 200px;
    height: 200px;
    background-color: var(--selfme-mint);
    border-radius: 50%;
    margin: 0 auto;
    animation: breathing 6s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--selfme-black);
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 0 20px rgba(106, 224, 194, 0.5);
}

@keyframes breathing {
    0%, 100% {
        transform: scale(1);
        background-color: var(--selfme-mint);
        box-shadow: 0 0 20px rgba(106, 224, 194, 0.5);
    }
    50% {
        transform: scale(1.2);
        background-color: var(--selfme-yellow);
        box-shadow: 0 0 30px rgba(255, 215, 106, 0.6);
    }
}

.emergency-card {
    background-color: rgba(106, 224, 194, 0.1);
    border: none;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.emergency-card .card-header {
    background-color: rgba(106, 224, 194, 0.2);
    border-bottom: none;
    color: var(--selfme-mint);
    font-weight: 600;
}

.emergency-message {
    font-size: 1.2rem;
    line-height: 1.8;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: rgba(255, 215, 106, 0.1);
    border-radius: 1rem;
    border-left: 4px solid var(--selfme-yellow);
}

/* Styles for the new interactive emergency sequence */
.emergency-step {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.emergency-step.active {
    display: block;
}

.progress-step {
    background-color: var(--selfme-mint);
    transition: width 0.6s ease;
}

/* Specific styling for grounding exercise */
.grounding-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    background-color: rgba(106, 224, 194, 0.1);
    height: 100%;
}

/* Emotion metrics cards layout */
.emotion-metric {
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    height: 100%;
}

.grounding-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(106, 224, 194, 0.3);
    cursor: pointer;
}

/* Styling for affirmation cards */
.affirmation-card {
    background-color: rgba(255, 215, 106, 0.1);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.affirmation-card:hover {
    box-shadow: 0 8px 25px rgba(255, 215, 106, 0.2);
}

/* Animation for fading in and out */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Animation for shaking during grounding reset */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s;
}

/* Help resources panel */
.help-resources {
    border-left: 4px solid var(--selfme-yellow);
    background-color: rgba(31, 31, 31, 0.95);
}

/* Mood buttons */
.mood-btn {
    transition: all 0.3s ease;
    height: 100%;
}

.mood-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .breathing-circle {
        width: 150px;
        height: 150px;
    }
    
    .btn-emergency {
        width: 40px;
        height: 40px;
        bottom: 60px;
    }
    
    .mood-btn {
        margin-bottom: 1rem;
    }
    
    .progress {
        height: 8px !important;
    }
}

/* Custom styling for selfme icon */
.selfme-icon {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
}

/* Keep the 'How it works' steps together */
.steps-container .row {
    display: flex;
    flex-wrap: wrap;
}

.steps-container .col-md-3 {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
}

/* Prevent the step 4 from getting isolated */
@media (max-width: 768px) {
    .steps-container .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Text overflow management for affirmations */
.text-wrap-break {
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    word-wrap: break-word;
}

.text-container-safe {
    overflow: hidden;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

/* Selfer affirmations specific styles */
.selfer-content {
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    line-height: 1.5;
    white-space: normal;
}

.selfer-list-item .ms-2.me-auto {
    max-width: calc(100% - 80px);
    overflow: hidden;
}

/* Force text to wrap in Bootstrap list items */
.list-group-item .selfer-content {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}