/* CureClass CBT Application Styles */

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

.cbt-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.stat-item h3 {
    font-size: 2.5em;
    margin: 0 0 10px 0;
    color: #007cba;
}

.stat-item p {
    margin: 0;
    color: #6c757d;
    font-weight: 500;
}

.cbt-start-button {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 20px auto;
    padding: 15px 30px;
    font-size: 1.1em;
}

.cbt-sessions-list {
    margin-top: 20px;
}

.cbt-session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 10px;
    background: #fff;
    transition: all 0.2s ease;
}

.cbt-session-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.session-date {
    font-weight: 500;
    color: #6c757d;
    min-width: 100px;
}

.session-summary {
    flex: 1;
    margin: 0 20px;
    color: #495057;
}

.session-improvement {
    font-weight: 600;
    color: #28a745;
    margin-right: 15px;
}

/* CBT Session Styles */
.cbt-session {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.cbt-step {
    margin-bottom: 30px;
}

.cbt-step h3 {
    color: #007cba;
    margin-bottom: 10px;
    font-size: 1.4em;
}

.cbt-step p {
    color: #6c757d;
    margin-bottom: 20px;
    line-height: 1.6;
}

.input-method-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

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

.voice-input p {
    margin: 10px 0;
    color: #dc3545;
    font-weight: 500;
}

.intensity-label {
    text-align: center;
    font-weight: 600;
    color: #007cba;
    margin-top: 10px;
}

.step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.ai-response {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
    margin-top: 20px;
}

.ai-response h4 {
    color: #007cba;
    margin-bottom: 15px;
}

.ai-content {
    line-height: 1.6;
    color: #495057;
}

.ai-content br {
    margin-bottom: 10px;
}

/* View Session Styles */
.cbt-view-session {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.session-details {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.session-section {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 20px;
}

.session-section:last-child {
    border-bottom: none;
}

.session-section h3 {
    color: #007cba;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.session-section p {
    color: #495057;
    line-height: 1.6;
    margin: 0;
}

.intensity {
    font-weight: 600;
    color: #28a745;
    margin-top: 5px;
}

/* Sessions List Styles */
.cbt-sessions-list {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.cbt-sessions-list h3 {
    color: #007cba;
    margin-bottom: 20px;
    text-align: center;
}

.session-card {
    margin-bottom: 15px;
    transition: all 0.2s ease;
}

.session-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.session-date {
    font-weight: 500;
    color: #6c757d;
}

.session-improvement {
    font-weight: 600;
    color: #28a745;
    background: #d4edda;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.session-summary {
    color: #495057;
    margin-bottom: 10px;
    line-height: 1.5;
}

.session-emotions {
    font-size: 0.9em;
    color: #6c757d;
}

/* Loading and Error States */
.cbt-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.cbt-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cbt-error {
    text-align: center;
    padding: 20px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #721c24;
    margin: 20px 0;
}

.cbt-fallback {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin: 20px 0;
}

.cbt-fallback p {
    margin-bottom: 15px;
    color: #6c757d;
}

.cbt-fallback a {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
}

.cbt-fallback a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cbt-dashboard,
    .cbt-session,
    .cbt-view-session,
    .cbt-sessions-list {
        padding: 10px;
    }
    
    .cbt-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cbt-session-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .session-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .step-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .input-method-selector {
        flex-direction: column;
    }
}

/* WordPress Admin Integration */
.wp-admin .cbt-dashboard,
.wp-admin .cbt-session,
.wp-admin .cbt-view-session,
.wp-admin .cbt-sessions-list {
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

/* Accessibility */
.cbt-step button:focus,
.cbt-session-item button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .step-navigation,
    .input-method-selector,
    button {
        display: none !important;
    }
    
    .cbt-step,
    .session-section {
        break-inside: avoid;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .cbt-dashboard,
    .cbt-session,
    .cbt-view-session,
    .cbt-sessions-list {
        background: #1e1e1e;
        color: #e1e1e1;
    }
    
    .stat-item,
    .ai-response {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .cbt-session-item,
    .session-card {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .cbt-step p,
    .session-section p,
    .session-summary {
        color: #e1e1e1;
    }
    
    .session-date,
    .session-emotions {
        color: #a0a0a0;
    }
}

/* Animation for step transitions */
.cbt-step {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Progress indicator */
.step-indicator {
    background: #007cba;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

/* Card header improvements */
.components-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.components-card__header h2 {
    margin: 0;
    flex: 1;
}

/* Form improvements */
.components-textarea-control__input,
.components-text-control__input {
    border: 1px solid #8c8f94;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.4;
}

.components-textarea-control__input:focus,
.components-text-control__input:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
    outline: none;
}

/* Range control improvements */
.components-range-control__range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.components-range-control__range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007cba;
    cursor: pointer;
}

.components-range-control__range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007cba;
    cursor: pointer;
    border: none;
} 