/**
 * Hiryo Organization - Base Body Styles
 * 
 * Unified base styles for consistent typography, spacing, and layout
 * across the entire admin dashboard.
 * 
 * @author HiryoOrg Development Team
 * @version 2.0
 */

/* === DOCUMENT FOUNDATION === */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

/* === TYPOGRAPHY SYSTEM === */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
}

h1 { 
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
}

h2 { 
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-semibold);
}

h3 { 
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
}

h4 { 
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-medium);
}

h5 { 
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
}

h6 { 
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
}

p {
    margin: 0 0 var(--space-4) 0;
    line-height: var(--line-height-normal);
    color: var(--text-primary);
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--brand-accent);
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* === FORM ELEMENTS === */
input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

input, textarea, select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    box-sizing: border-box;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

input::placeholder, textarea::placeholder {
    color: var(--text-tertiary);
}

button {
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    color: inherit;
    transition: all var(--transition-fast);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* === LISTS === */
ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* === IMAGES === */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === UTILITY CLASSES === */
.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;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* === SCROLLBAR STYLING === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}

/* === SELECTION === */
::selection {
    background-color: rgba(76, 175, 80, 0.2);
    color: var(--text-primary);
}

::-moz-selection {
    background-color: rgba(76, 175, 80, 0.2);
    color: var(--text-primary);
}

/* === FOCUS STYLES === */
:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* === PRINT STYLES === */
@media print {
    html, body, div, span, h1, h2, h3, h4, h5, h6,
    p, a, img, ul, ol, li,
    form, input, button, select, textarea,
    table, tr, td, th,
    nav, header, main, section, article, aside, footer {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a, a:visited {
        text-decoration: underline;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    abbr[title]:after {
        content: " (" attr(title) ")";
    }
    
    .no-print {
        display: none !important;
    }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    html, body, div, span, h1, h2, h3, h4, h5, h6,
    p, a, img, ul, ol, li,
    form, input, button, select, textarea,
    table, tr, td, th,
    nav, header, main, section, article, aside, footer {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}