/* Global modern stylesheet for HARA project */

/* --------------------------------------------------- */
/* 1. CSS Variables (Color palette, spacing, fonts) */
/* --------------------------------------------------- */
:root {
    /* Primary gradient */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);

    /* Accent colors */
    --color-primary: #667eea;
    --color-primary-dark: #5a5fd9;
    --color-secondary: #f093fb;
    --color-secondary-dark: #e05edb;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;

    /* Neutral palette */
    --color-bg: #ffffff;
    --color-bg-dark: #1a202c;
    --color-surface: #ffffff;
    --color-surface-dark: #2d3748;
    --color-text: #2d3748;
    --color-text-light: #ffffff;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Font */
    --font-base: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.5rem;
}

/* --------------------------------------------------- */
/* 2. Dark mode overrides */
/* --------------------------------------------------- */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: var(--color-bg-dark);
        --color-surface: var(--color-surface-dark);
        --color-text: var(--color-text-light);
    }
}

/* --------------------------------------------------- */
/* 3. Global resets & base styles */
/* --------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    font-family: var(--font-base);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary);
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* --------------------------------------------------- */
/* 4. Utility classes */
/* --------------------------------------------------- */
/* 유틸리티 클래스(.text-*, .mt-*, .mb-*, .container 등)는 style.css에서 정의 */

/* --------------------------------------------------- */
/* 5. Buttons – 기본 스타일은 style.css에서 정의 */
/* --------------------------------------------------- */
/* 버튼 기본 스타일은 style.css에 통합됨 */

/* --------------------------------------------------- */
/* 6. Card component – 기본 스타일은 style.css에서 정의 */
/* --------------------------------------------------- */
/* 카드 기본 스타일은 style.css에 통합됨 */

/* --------------------------------------------------- */
/* 7. Form elements – refined */
/* --------------------------------------------------- */
.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--spacing-md);
}

.input-group label {
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--color-text);
}

.input-group input,
.input-group select,
.input-group textarea {
    padding: var(--spacing-sm);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    transition: border-color 0.2s, background 0.2s;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: #f8faff;
}

/* --------------------------------------------------- */
/* 8. Badge / tag */
/* --------------------------------------------------- */
.badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: var(--color-success);
    color: var(--color-text-light);
}

.badge-danger {
    background: var(--color-danger);
    color: var(--color-text-light);
}

.badge-warning {
    background: var(--color-warning);
    color: var(--color-text-light);
}

.badge-info {
    background: var(--color-info);
    color: var(--color-text-light);
}

/* --------------------------------------------------- */
/* 9. Animations – subtle fade/slide */
/* --------------------------------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.5s ease-out forwards;
}

/* --------------------------------------------------- */
/* 10. Responsive utilities */
/* --------------------------------------------------- */

/* 터치 친화적 최소 크기 */
@media (pointer: coarse) {
    button,
    a.btn,
    input[type="submit"],
    input[type="button"],
    .clickable {
        min-height: 44px;
        min-width: 44px;
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-lg: 20px;
        --spacing-xl: 28px;
        --font-size-base: 0.95rem;
    }

    /* 모바일에서 수평 스크롤 방지 */
    body {
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    :root {
        --spacing-md: 12px;
        --spacing-lg: 16px;
        --font-size-base: 0.9rem;
    }
}

/* --------------------------------------------------- */
/* 11. Scrollbar styling (WebKit & Firefox) */
/* --------------------------------------------------- */

/* Firefox */
* {
    scrollbar-width: auto;
    scrollbar-color: #888888 #faf8f5;
}

/* WebKit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

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

::-webkit-scrollbar-thumb {
    background: #888888;
    border-radius: 7px;
    border: 3px solid #faf8f5;
}

::-webkit-scrollbar-thumb:hover {
    background: #666666;
}

::-webkit-scrollbar-thumb:active {
    background: #555555;
}

/* --------------------------------------------------- */
/* 12. Accessibility focus outline */
/* --------------------------------------------------- */
:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* End of global.css */