/* mojisucount.com - Custom Styles */

/* Base Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-feature-settings: "palt" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Japanese Text Optimization */
.japanese-text {
    font-family: 'Noto Sans JP', 'Meiryo', 'Hiragino Kaku Gothic ProN', sans-serif;
    line-height: 1.8;
}

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

textarea::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* Section Header */
.section-header {
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Donut Chart Animation */
.donut-segment {
    transition: stroke-dasharray 0.5s ease, stroke-dashoffset 0.5s ease;
}

/* Button Hover Effects */
button {
    transition: all 0.2s ease;
}

button:active {
    transform: scale(0.98);
}

/* Stats Card Hover */
.bg-white.border {
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.bg-white.border:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Progress Bar Animation */
#goal-progress-bar,
[id$="-bar"] {
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* Modal Animation */
#goal-modal {
    animation: fadeIn 0.2s ease;
}

#goal-modal > div {
    animation: slideIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Number Counter Animation */
.counter-animate {
    animation: countUp 0.3s ease;
}

@keyframes countUp {
    0% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* FAQ Accordion */
details > summary {
    list-style: none;
}

details > summary::-webkit-details-marker {
    display: none;
}

details[open] > summary {
    color: #004098;
}

details > p {
    animation: fadeIn 0.3s ease;
}

/* Material Icons Alignment */
.material-symbols-outlined {
    vertical-align: middle;
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
}

/* Focus Styles for Accessibility */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* Selection Color */
::selection {
    background-color: #E6F0FF;
    color: #004098;
}

/* Responsive Typography */
@media (max-width: 640px) {
    .text-3xl {
        font-size: 1.5rem;
    }
    
    .text-2xl {
        font-size: 1.25rem;
    }
}

/* Print Styles */
@media print {
    header,
    footer,
    .bg-stone-50,
    button {
        display: none !important;
    }
    
    textarea {
        border: 1px solid #ccc !important;
        height: auto !important;
    }
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e5e5e5;
    border-top-color: #4A90E2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Warning/Error States */
.text-warning {
    color: #f59e0b;
}

.text-danger {
    color: #ef4444;
}

.bg-danger-light {
    background-color: #fef2f2;
}

/* Goal Progress States */
.goal-normal #goal-progress-bar {
    background-color: #4A90E2;
}

.goal-warning #goal-progress-bar {
    background-color: #f59e0b;
}

.goal-danger #goal-progress-bar {
    background-color: #ef4444;
}

/* SNS Progress Bar Colors */
.sns-over {
    background-color: #ef4444 !important;
}

/* Tooltip (optional enhancement) */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background-color: #333;
    color: white;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 4px);
}

/* Table Styles */
table {
    border-collapse: collapse;
}

tbody tr:hover {
    background-color: #f9fafb;
}

/* Smooth transitions for all interactive elements */
a, button, input, textarea {
    transition: all 0.2s ease;
}

/* Custom focus ring for textarea */
textarea:focus {
    box-shadow: inset 0 0 0 2px #E6F0FF;
}

/* Ensure proper text wrapping */
.break-word {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
