/* Therapy Constellation Studio - Custom Styles */

/* Import Inter font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.dark ::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Constellation Canvas Styles */
#constellationCanvas {
    position: relative;
    overflow: hidden;
}

#constellationCanvas svg {
    width: 100%;
    height: 100%;
}

/* Session Node Styles */
.session-node {
    cursor: pointer;
    transition: all 0.2s ease;
}

.session-node:hover {
    filter: brightness(1.2);
}

.session-node.selected {
    stroke: #0ea5e9;
    stroke-width: 3px;
}

/* Connection Lines */
.connection-line {
    stroke: #cbd5e1;
    stroke-width: 1px;
    stroke-opacity: 0.3;
}

.dark .connection-line {
    stroke: #475569;
}

/* Tooltip Styles */
.tooltip {
    position: absolute;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: 1000;
    max-width: 300px;
}

.dark .tooltip {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.tooltip-date {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 4px;
}

.dark .tooltip-date {
    color: #94a3b8;
}

.tooltip-mood {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.tooltip-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.tooltip-tag {
    font-size: 0.625rem;
    padding: 2px 6px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 4px;
}

.dark .tooltip-tag {
    background: #0c4a6e;
    color: #7dd3fc;
}

.tooltip-note {
    font-size: 0.75rem;
    color: #475569;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark .tooltip-note {
    color: #cbd5e1;
}

/* Session Card Styles */
.session-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.dark .session-card {
    background: #1e293b;
    border-color: #334155;
}

.session-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.session-card-date {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
}

.dark .session-card-date {
    color: #f1f5f9;
}

.session-card-mood {
    font-size: 1.5rem;
}

.session-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.session-card-tag {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 6px;
    font-weight: 500;
}

.dark .session-card-tag {
    background: #0c4a6e;
    color: #7dd3fc;
}

.session-card-note {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark .session-card-note {
    color: #94a3b8;
}

/* Constellation Card Styles */
.constellation-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.dark .constellation-card {
    background: #1e293b;
    border-color: #334155;
}

.constellation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.constellation-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.constellation-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0f172a;
}

.dark .constellation-card-title {
    color: #f1f5f9;
}

.constellation-card-date {
    font-size: 0.75rem;
    color: #64748b;
}

.dark .constellation-card-date {
    color: #94a3b8;
}

.constellation-card-sessions {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 12px;
}

.dark .constellation-card-sessions {
    color: #94a3b8;
}

.constellation-card-insight {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark .constellation-card-insight {
    color: #cbd5e1;
}

/* Selected Session Item in Sidebar */
.selected-session-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    position: relative;
}

.dark .selected-session-item {
    background: #0f172a;
    border-color: #334155;
}

.selected-session-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}

.selected-session-date {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
}

.dark .selected-session-date {
    color: #f1f5f9;
}

.selected-session-mood {
    font-size: 1.25rem;
}

.selected-session-remove {
    padding: 2px;
    color: #64748b;
    transition: color 0.2s;
}

.selected-session-remove:hover {
    color: #ef4444;
}

.dark .selected-session-remove {
    color: #94a3b8;
}

.selected-session-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.selected-session-tag {
    font-size: 0.625rem;
    padding: 2px 6px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 4px;
}

.dark .selected-session-tag {
    background: #0c4a6e;
    color: #7dd3fc;
}

/* Mood Button Active States */
.mood-btn.active {
    border-color: currentColor;
    background: currentColor;
    color: white;
}

.mood-btn[data-mood="positive"].active {
    border-color: #10b981;
    background: #10b981;
}

.mood-btn[data-mood="neutral"].active {
    border-color: #0ea5e9;
    background: #0ea5e9;
}

.mood-btn[data-mood="challenging"].active {
    border-color: #f59e0b;
    background: #f59e0b;
}

.mood-btn[data-mood="difficult"].active {
    border-color: #ef4444;
    background: #ef4444;
}

.mood-btn[data-mood="breakthrough"].active {
    border-color: #8b5cf6;
    background: #8b5cf6;
}

/* Provider Button Active States */
.provider-btn.active {
    border-color: #0ea5e9;
    background: rgba(14, 165, 233, 0.1);
}

/* Toast Notification Styles */
.toast {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.dark .toast {
    background: #1e293b;
    border-color: #334155;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.info {
    border-left: 4px solid #0ea5e9;
}

.toast.warning {
    border-left: 4px solid #f59e0b;
}

.toast-icon {
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #0f172a;
    margin-bottom: 2px;
}

.dark .toast-title {
    color: #f1f5f9;
}

.toast-message {
    font-size: 0.75rem;
    color: #64748b;
}

.dark .toast-message {
    color: #94a3b8;
}

.toast-close {
    flex-shrink: 0;
    padding: 4px;
    color: #64748b;
    cursor: pointer;
    transition: color 0.2s;
}

.dark .toast-close {
    color: #94a3b8;
}

.toast-close:hover {
    color: #0f172a;
}

.dark .toast-close:hover {
    color: #f1f5f9;
}

/* Modal Animations */
.modal-enter {
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* e-Ink Mode Styles */
body.eink-mode {
    background: white !important;
    color: black !important;
}

body.eink-mode * {
    transition: none !important;
    animation: none !important;
}

body.eink-mode .bg-slate-50,
body.eink-mode .dark\:bg-slate-900,
body.eink-mode .dark\:bg-slate-800,
body.eink-mode .dark\:bg-slate-700 {
    background: white !important;
}

body.eink-mode .text-slate-900,
body.eink-mode .dark\:text-slate-100,
body.eink-mode .dark\:text-slate-300 {
    color: black !important;
}

body.eink-mode .border-slate-200,
body.eink-mode .dark\:border-slate-700,
body.eink-mode .dark\:border-slate-600 {
    border-color: #000 !important;
}

body.eink-mode .shadow-sm,
body.eink-mode .shadow-lg,
body.eink-mode .shadow-xl {
    box-shadow: none !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    #sidebarBuilder {
        width: 100%;
    }
    
    .session-card {
        padding: 12px;
    }
    
    .constellation-card {
        padding: 16px;
    }
}

/* Print Styles for PDF Export */
@media print {
    body {
        background: white;
        color: black;
    }
    
    header,
    button,
    .no-print {
        display: none !important;
    }
    
    .session-card,
    .constellation-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Focus Styles for Accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #0ea5e9;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Custom Checkbox/Toggle Styles */
input[type="checkbox"]:checked {
    background-color: #0ea5e9;
    border-color: #0ea5e9;
}

/* Selection Styles */
::selection {
    background: rgba(14, 165, 233, 0.2);
    color: inherit;
}

/* Smooth Transitions */
.transition-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Utility Classes */
.text-balance {
    text-wrap: balance;
    -webkit-text-wrap: balance;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mood Color Classes */
.mood-positive {
    color: #10b981;
}

.mood-neutral {
    color: #0ea5e9;
}

.mood-challenging {
    color: #f59e0b;
}

.mood-difficult {
    color: #ef4444;
}

.mood-breakthrough {
    color: #8b5cf6;
}

.bg-mood-positive {
    background-color: #10b981;
}

.bg-mood-neutral {
    background-color: #0ea5e9;
}

.bg-mood-challenging {
    background-color: #f59e0b;
}

.bg-mood-difficult {
    background-color: #ef4444;
}

.bg-mood-breakthrough {
    background-color: #8b5cf6;
}

/* Gradient Backgrounds */
.gradient-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.gradient-secondary {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* Card Hover Effects */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    width: 6rem;
    height: 6rem;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.dark .empty-state-description {
    color: #94a3b8;
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-primary {
    background: rgba(14, 165, 233, 0.1);
    color: #0369a1;
}

.dark .badge-primary {
    background: rgba(14, 165, 233, 0.2);
    color: #7dd3fc;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
}

.dark .badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
}

.dark .badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.dark .badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Divider */
.divider {
    height: 1px;
    background: #e2e8f0;
    margin: 1rem 0;
}

.dark .divider {
    background: #334155;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
