/* Base Styles - GymProject (FIST X Brand) */

:root {
    /* FIST X Brand Colors - FISTX_BI_v1 */
    --fistx-orange: #FE5000;
    --fistx-iron: #191919;
    --fistx-steel: #303030;
    --fistx-chrome: #D3D3D3;
    --fistx-silver: #ECECEC;
    
    /* Semantic Colors */
    --primary-color: #FE5000;
    --primary-dark: #E54800;
    --secondary-color: #303030;
    --accent-color: #FE5000;
    --background-dark: #191919;
    --background-light: #ECECEC;
    --surface-color: #FFFFFF;
    --text-primary: #191919;
    --text-secondary: #303030;
    --text-muted: #666666;
    --border-color: #D3D3D3;
    --success-color: #FE5000;
    --warning-color: #FFB800;
    --error-color: #FF4757;
    --info-color: #FE5000;
    
    /* Typography - FIST X */
    --font-brand: 'Moderniz', 'Bebas Neue', 'Bebas', sans-serif;
    --font-primary: 'Inter Display', 'Noto Sans CJK KR', 'Noto Sans KR', sans-serif;
    --font-display: 'Moderniz', 'Bebas Neue', 'Bebas', sans-serif;
    --font-accent: 'Bebas', 'Bebas Neue', sans-serif;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.25);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    width: 100%;
}

body {
    font-family: var(--font-primary);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--background-light);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* Logo - FIST X: Moderniz, 대문자, 자간 -20 (디자인 기준, 웹에서는 -0.02em 적용) */
.logo {
    font-family: var(--font-brand);
    font-size: 2rem;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.logo span {
    color: var(--primary-color);
}

/* Top Bar - 공통 스타일 */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-xl);
    padding-left: calc(var(--spacing-xl) + var(--spacing-sm));
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-nav {
    display: flex;
    gap: var(--spacing-lg);
}

.nav-item {
    color: var(--text-secondary);
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(254, 80, 0, 0.1);
}

.nav-item.active {
    color: var(--primary-color);
    background: rgba(254, 80, 0, 0.15);
}

/* Buttons */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    gap: var(--spacing-xs);
}

button:disabled, .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--fistx-silver);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--fistx-chrome);
}

.btn-add {
    background: var(--accent-color);
    color: var(--text-primary);
}

.btn-add:hover:not(:disabled) {
    filter: brightness(1.1);
}

.btn-edit {
    background: var(--info-color);
    color: var(--text-primary);
}

.btn-new {
    background: var(--background-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-new:hover:not(:disabled) {
    background: var(--surface-color);
    border-color: var(--primary-color);
}

.btn-delete {
    background: var(--error-color);
    color: var(--text-primary);
}

.btn-delete:hover:not(:disabled) {
    filter: brightness(1.1);
}

.btn-save {
    background: var(--success-color);
    color: var(--text-primary);
}

.btn-cancel {
    background: var(--text-muted);
    color: var(--text-primary);
}

.btn-confirm {
    background: var(--primary-color);
    color: var(--text-primary);
}

.btn-logout {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 12px;
}

.btn-logout:hover {
    background: var(--error-color);
    border-color: var(--error-color);
    color: var(--text-primary);
}

/* Top Bar Right - 공통 스타일 */
.top-bar-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    white-space: nowrap;
    flex-shrink: 0;
}

.top-bar-right .user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Form Elements */
input, select, textarea {
    font-family: var(--font-primary);
    font-size: 14px;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(254, 80, 0, 0.2);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

input[type="checkbox"] {
    width: auto;
    margin-right: var(--spacing-xs);
}

label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.help-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

/* Tables */
.data-table-wrapper {
    overflow-x: auto;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--fistx-silver);
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.data-table tr:hover {
    background: rgba(254, 80, 0, 0.05);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--error-color);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* Cards */
.card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: var(--spacing-lg);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

::-webkit-scrollbar-track {
    background: var(--fistx-silver);
}

::-webkit-scrollbar-thumb {
    background: var(--fistx-chrome);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fistx-steel);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-error { color: var(--error-color); }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.fade-in {
    animation: fadeIn var(--transition-normal);
}

.slide-up {
    animation: slideUp var(--transition-normal);
}

/* Theme Toggle Button */
.theme-toggle {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: var(--radius-md);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--background-light);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.theme-icon {
    display: inline-block;
    transition: transform var(--transition-fast);
    line-height: 1;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(15deg);
}

/* Dark Mode - FIST X 블랙/메탈 톤 */
[data-theme="dark"] {
    --background-dark: #191919;
    --background-light: #191919;
    --surface-color: #303030;
    --text-primary: #ECECEC;
    --text-secondary: #D3D3D3;
    --text-muted: #999999;
    --border-color: #4A4A4A;
}

[data-theme="dark"] body {
    background: #191919;
}

[data-theme="dark"] .btn-primary {
    color: white;
}

[data-theme="dark"] .btn-secondary {
    background: #303030;
}

[data-theme="dark"] .btn-secondary:hover:not(:disabled) {
    background: #191919;
}

[data-theme="dark"] .btn-add {
    color: var(--text-primary);
}

[data-theme="dark"] .btn-save {
    color: var(--text-primary);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #303030;
    color: var(--text-primary);
}

[data-theme="dark"] .data-table th {
    background: #303030;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #191919;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #666666;
}

[data-theme="dark"] .modal {
    background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .theme-toggle {
    background: #303030;
    border-color: #4A4A4A;
    color: #ECECEC;
}

[data-theme="dark"] .theme-toggle:hover {
    background: #191919;
    border-color: var(--primary-color);
}
