/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary: #3655ea;
    --primary-hover: #2845d9;
    --primary-active: #1e35c8;
    --primary-light: #607afb;
    --primary-bg: rgba(54, 85, 234, 0.1);
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --white: #ffffff;
    --black: #000000;
    
    /* Emotion Colors */
    --joy: #facc15;
    --joy-bg: #fef9c3;
    --sadness: #60a5fa;
    --sadness-bg: #dbeafe;
    --anger: #ef4444;
    --anger-bg: #fee2e2;
    --calm: #34d399;
    --calm-bg: #d1fae5;
    --neutral: #d5c7b4;
    --neutral-bg: rgba(213, 206, 180, 0.5);
    --anxiety: #c084fc;
    --anxiety-bg: #f3e8ff;
    
    --error: #ef4444;
    --success: #22c55e;
    
    /* Shadows */
    --shadow-sm: 0px 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0px 10px 15px -3px rgba(0, 0, 0, 0.1), 0px 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0px 20px 25px -5px rgba(0, 0, 0, 0.1), 0px 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-card: 6px 6px 20px 3px rgba(219, 217, 221, 0.15), -9px 0px 30px 0px rgba(216, 214, 218, 0.15);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--gray-800);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
    height: 48px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:active {
    background-color: var(--primary-active);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background-color: var(--gray-50);
    border-color: var(--gray-300);
}

.btn-secondary:active {
    background-color: var(--gray-100);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--gray-50);
}

.btn-full {
    width: 100%;
}

.btn-ghost {
    background: transparent;
    color: var(--gray-500);
}

.btn-ghost:hover {
    background-color: var(--gray-100);
    color: var(--gray-900);
}

/* Links */
.link-primary {
    color: var(--primary-light);
    font-weight: 700;
    transition: color var(--transition-fast);
}

.link-primary:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.link-btn {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 700;
    background: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.link-btn:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Logo */
.logo {
    width: 32px;
    height: 32px;
    background-color: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 0.875rem;
}

/* Divider */
.divider {
    height: 1px;
    background-color: var(--gray-100);
    width: 100%;
    margin: 0.5rem 0;
}

/* Emotion Dot */
.emotion-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

/* Widget Base */
.widget {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

/* Modal Base */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.close-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--gray-500);
    transition: all var(--transition-fast);
}

.close-btn:hover {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        font-size: 14px;
    }
}
