/* Joy Buddy - Modern Minimal Style */

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Typography */
body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior: none;
}

/* Vertical Text */
.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* Navigation */
.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    color: #9CA3AF;
    transition: all 0.2s ease;
}

.nav-btn.active {
    color: #7C3AED;
}

.nav-btn:active {
    transform: scale(0.95);
}

/* Emotion Grid Canvas */
#emotionGrid {
    cursor: crosshair;
    touch-action: none;
}

/* Emotion Buttons */
.emotion-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 12px;
    transition: all 0.2s ease;
    background: white;
    border: 2px solid transparent;
}

.emotion-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.emotion-btn.selected {
    border-color: #7C3AED;
    background: linear-gradient(135deg, #F3E7FC, #EDE9FE);
}

.emotion-btn:active {
    transform: scale(0.95);
}

/* Activity Tags */
.activity-tag {
    padding: 8px 16px;
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.activity-tag:hover {
    border-color: #7C3AED;
    background: #F3E7FC;
    color: #7C3AED;
    transform: translateY(-1px);
}

.activity-tag.selected {
    background: linear-gradient(135deg, #7C3AED, #6366F1);
    border-color: transparent;
    color: white;
}

/* Sliders */
.slider-purple {
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #E5E7EB 0%, #E5E7EB 50%, #E5E7EB 100%);
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.slider-purple:hover {
    opacity: 1;
}

.slider-purple::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #7C3AED, #6366F1);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
    transition: all 0.2s ease;
}

.slider-purple::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 12px rgba(124, 58, 237, 0.4);
}

.slider-purple::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #7C3AED, #6366F1);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
    transition: all 0.2s ease;
}

.slider-blue {
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #E5E7EB 0%, #E5E7EB 50%, #E5E7EB 100%);
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.slider-blue::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #3B82F6, #06B6D4);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.slider-blue::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #3B82F6, #06B6D4);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Calendar */
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: white;
}

.calendar-day:hover {
    background: #F3F4F6;
}

.calendar-day.today {
    background: linear-gradient(135deg, #7C3AED, #6366F1);
    color: white;
    font-weight: 600;
}

.calendar-day.has-emotion {
    position: relative;
}

.calendar-day.has-emotion::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #7C3AED;
    border-radius: 50%;
}

/* Emotion Entry Cards */
.emotion-entry {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.emotion-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Toast Notifications */
.toast {
    background: white;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s ease-out;
    margin-bottom: 8px;
}

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

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

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

.toast.info {
    border-left: 4px solid #3B82F6;
}

/* Focus Styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    ring: 2px;
    ring-color: #7C3AED;
    border-color: #7C3AED;
}

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

.tab-content {
    animation: fadeIn 0.3s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #9CA3AF;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6B7280;
}

/* Safe Area Insets */
@supports (padding: max(0px)) {
    nav {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #E5E7EB;
    border-top-color: #7C3AED;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 380px) {
    .emotion-btn span {
        font-size: 10px;
    }
    
    .activity-tag {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here if needed */
}

/* Print Styles */
@media print {
    nav,
    header button {
        display: none;
    }
}