/* ============================================
   SERVICE APP X - DESIGN SYSTEM
   v1.0 - 2025-10-06
   
   Egységes, letisztult, könnyen használható design
   minden felhasználónak (beleértve idősebb kollégákat)
   ============================================ */

/* ============================================
   CSS VÁLTOZÓK (ROOT)
   ============================================ */
:root {
    /* ===== COLORS ===== */
    /* Primary - Kék */
    --primary: #0d6efd;
    --primary-hover: #0b5ed7;
    --primary-light: #cfe2ff;
    --primary-dark: #084298;
    
    /* Success - Zöld */
    --success: #198754;
    --success-hover: #157347;
    --success-light: #d1e7dd;
    --success-dark: #0f5132;
    
    /* Danger - Piros */
    --danger: #dc3545;
    --danger-hover: #bb2d3b;
    --danger-light: #f8d7da;
    --danger-dark: #842029;
    
    /* Warning - Sárga */
    --warning: #ffc107;
    --warning-hover: #ffca2c;
    --warning-light: #fff3cd;
    --warning-dark: #997404;
    
    /* Orange - Narancs */
    --orange: #fd7e14;
    --orange-hover: #e67300;
    --orange-light: #ffe5d0;
    --orange-dark: #984c0c;
    
    /* Info - Cyan */
    --info: #0dcaf0;
    --info-hover: #31d2f2;
    --info-light: #cff4fc;
    --info-dark: #087990;
    
    /* Purple - Lila */
    --purple: #6f42c1;
    --purple-hover: #5a32a3;
    --purple-light: #e2d9f3;
    --purple-dark: #432874;
    
    /* Neutral - Szürke */
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --black: #000000;
    
    /* ===== TYPOGRAPHY ===== */
    --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    
    /* Font Sizes - NAGYOBB mint szokásos! */
    --font-size-base: 1.125rem;      /* 18px */
    --font-size-xs: 0.875rem;        /* 14px */
    --font-size-sm: 1rem;            /* 16px */
    --font-size-md: 1.125rem;        /* 18px */
    --font-size-lg: 1.25rem;         /* 20px */
    --font-size-xl: 1.5rem;          /* 24px */
    --font-size-2xl: 2rem;           /* 32px */
    --font-size-3xl: 2.5rem;         /* 40px */
    
    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-base: 1.6;
    --line-height-loose: 1.8;
    
    /* ===== SPACING ===== */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;
    
    /* ===== BORDERS ===== */
    --border-radius-sm: 4px;
    --border-radius-md: 6px;
    --border-radius-lg: 8px;
    --border-radius-xl: 12px;
    --border-radius-pill: 50px;
    
    /* ===== SHADOWS ===== */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-xl: 0 8px 24px rgba(0,0,0,0.12);
    
    /* ===== TRANSITIONS ===== */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================
   BASE STYLES
   ============================================ */
body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--gray-900);
    background: var(--gray-100);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-4);
}

h1 { font-size: 2.5rem; }      /* 40px */
h2 { font-size: 2rem; }        /* 32px */
h3 { font-size: 1.75rem; }     /* 28px */
h4 { font-size: 1.5rem; }      /* 24px */
h5 { font-size: 1.25rem; }     /* 20px */
h6 { font-size: 1.125rem; }    /* 18px */

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

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

/* ============================================
   STAT CARDS (Dashboard Statistics)
   ============================================ */
.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--border-radius-xl);
    padding: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-5);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    margin-bottom: var(--space-5);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-card-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #084298 100%);
}

.stat-card-success {
    background: linear-gradient(135deg, #198754 0%, #0f5132 100%);
}

.stat-card-danger {
    background: linear-gradient(135deg, #dc3545 0%, #842029 100%);
}

.stat-card-warning {
    background: linear-gradient(135deg, #ffc107 0%, #997404 100%);
}

.stat-card-orange {
    background: linear-gradient(135deg, #fd7e14 0%, #984c0c 100%);
}

.stat-card-info {
    background: linear-gradient(135deg, #0dcaf0 0%, #087990 100%);
}

.stat-icon {
    font-size: 3rem;
    opacity: 0.9;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: var(--font-size-sm);
    opacity: 0.9;
    margin-bottom: var(--space-2);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    line-height: 1;
}

/* Stat Card Link Wrapper */
.stat-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.stat-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.stat-card-link .stat-card {
    cursor: pointer;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-ds {
    padding: 12px 24px;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--border-radius-md);
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all var(--transition-base);
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-ds:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.btn-ds:active {
    transform: translateY(0);
}

.btn-ds i {
    font-size: 1.25rem;
}

/* Button Variants */
.btn-ds-primary {
    background: var(--primary);
    color: white;
}

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

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

.btn-ds-success:hover {
    background: var(--success-hover);
    color: white;
}

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

.btn-ds-danger:hover {
    background: var(--danger-hover);
    color: white;
}

.btn-ds-warning {
    background: var(--warning);
    color: var(--gray-900);
}

.btn-ds-warning:hover {
    background: var(--warning-hover);
    color: var(--gray-900);
}

.btn-ds-secondary {
    background: var(--gray-600);
    color: white;
}

.btn-ds-secondary:hover {
    background: var(--gray-700);
    color: white;
}

.btn-ds-outline {
    background: rgba(13, 110, 253, 0.08);  /* Enyhe kék háttér */
    border: 2px solid var(--primary);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);  /* Könnyű árnyék */
}

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

/* Button Sizes */
.btn-ds-sm {
    padding: 8px 16px;
    font-size: var(--font-size-sm);
    min-height: 40px;
}

.btn-ds-lg {
    padding: 16px 32px;
    font-size: var(--font-size-lg);
    min-height: 56px;
}

/* ============================================
   CARDS
   ============================================ */
.card-ds {
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    overflow: hidden;
    margin-bottom: var(--space-5);
}

.card-ds:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.card-ds-header {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    border-bottom: 2px solid var(--gray-300);
    padding: var(--space-5) var(--space-6);
}

.card-ds-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    margin: 0 0 var(--space-2) 0;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.card-ds-subtitle {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    margin: 0;
}

.card-ds-body {
    padding: var(--space-6);
}

.card-ds-footer {
    background: var(--gray-100);
    border-top: 1px solid var(--gray-300);
    padding: var(--space-4) var(--space-6);
}

/* ============================================
   TABS
   ============================================ */
.nav-tabs-ds {
    border-bottom: 3px solid var(--gray-300);
    gap: 4px;
    display: flex;
    flex-wrap: wrap;
}

.nav-tabs-ds .nav-link {
    border: none;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    padding: var(--space-4) var(--space-6);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    transition: all var(--transition-base);
    background: transparent;
}

.nav-tabs-ds .nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.nav-tabs-ds .nav-link.active {
    background: white;
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
    margin-bottom: -3px;
}

.nav-tabs-ds .nav-link i {
    font-size: 1.25rem;
}

.nav-tabs-ds .badge {
    background: var(--gray-200);
    color: var(--gray-700);
    font-size: var(--font-size-xs);
    padding: 4px 10px;
    border-radius: var(--border-radius-pill);
    font-weight: var(--font-weight-semibold);
}

.nav-tabs-ds .nav-link.active .badge {
    background: var(--primary);
    color: white;
}

/* ============================================
   TABLES
   ============================================ */
.table-ds-container {
    background: white;
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table-ds {
    width: 100%;
    margin: 0;
}

.table-ds thead {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
}

.table-ds thead th {
    padding: var(--space-4) var(--space-5);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-700);
    text-align: left;
    border-bottom: 2px solid var(--gray-300);
}

.table-ds tbody tr {
    transition: background var(--transition-fast);
}

.table-ds tbody tr:hover {
    background: var(--gray-100);
}

.table-ds tbody td {
    padding: var(--space-4) var(--space-5);
    font-size: var(--font-size-sm);
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

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

.table-ds a {
    color: var(--primary);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
}

.table-ds a:hover {
    text-decoration: underline;
}

/* CRITICAL: Preserve button styles in tables */
.table-ds a.btn-ds {
    color: white !important;
    text-decoration: none !important;
    font-weight: var(--font-weight-semibold) !important;
}

.table-ds a.btn-ds:hover {
    text-decoration: none !important;
}

/* ============================================
   BADGES
   ============================================ */
.badge-ds {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--border-radius-md);
    line-height: 1;
}

.badge-ds-new {
    background: var(--info-light);
    color: #055160;
    border: 1px solid #9eeaf9;
}

.badge-ds-progress {
    background: var(--primary-light);
    color: #052c65;
    border: 1px solid #9ec5fe;
}

.badge-ds-ready {
    background: var(--success-light);
    color: #0a3622;
    border: 1px solid #a3cfbb;
}

.badge-ds-warning {
    background: var(--warning-light);
    color: #664d03;
    border: 1px solid #ffe69c;
}

.badge-ds-danger {
    background: var(--danger-light);
    color: #58151c;
    border: 1px solid #f1aeb5;
}

.badge-ds-success {
    background: var(--success-light);
    color: #0a3622;
    border: 1px solid #a3cfbb;
}

.badge-ds-info {
    background: var(--info-light);
    color: #055160;
    border: 1px solid #9eeaf9;
}

.badge-ds-primary {
    background: var(--primary-light);
    color: #052c65;
    border: 1px solid #9ec5fe;
}

/* ============================================
   FORMS
   ============================================ */
.form-group-ds {
    margin-bottom: var(--space-6);
}

.form-label-ds {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-900);
    margin-bottom: var(--space-2);
}

.form-label-ds .required {
    color: var(--danger);
}

.form-control-ds {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: var(--font-size-md);
    line-height: 1.5;
    color: var(--gray-900);
    background: white;
    border: 2px solid var(--gray-400);
    border-radius: var(--border-radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control-ds:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
    outline: none;
}

.form-control-ds::placeholder {
    color: var(--gray-500);
}

.form-control-ds:disabled {
    background: var(--gray-200);
    cursor: not-allowed;
}

/* Safari/WebKit compatibility for search inputs */
input[type="search"].form-control-ds {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="search"].form-control-ds::-webkit-search-decoration,
input[type="search"].form-control-ds::-webkit-search-cancel-button,
input[type="search"].form-control-ds::-webkit-search-results-button,
input[type="search"].form-control-ds::-webkit-search-results-decoration {
    display: none;
}

.form-help-ds {
    font-size: var(--font-size-xs);
    color: var(--gray-600);
    margin-top: 6px;
}

/* ============================================
   ALERTS
   ============================================ */
.alert-ds {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--border-radius-lg);
    border-left: 4px solid;
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-5);
}

.alert-ds i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.alert-ds-success {
    background: var(--success-light);
    color: #0a3622;
    border-color: var(--success);
}

.alert-ds-danger {
    background: var(--danger-light);
    color: #58151c;
    border-color: var(--danger);
}

.alert-ds-warning {
    background: var(--warning-light);
    color: #664d03;
    border-color: var(--warning);
}

.alert-ds-info {
    background: var(--info-light);
    color: #055160;
    border-color: var(--info);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    /* Stat Cards - Stack vertically */
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    /* Buttons - Full width */
    .btn-ds {
        width: 100%;
        justify-content: center;
    }
    
    /* Tabs - Smaller padding */
    .nav-tabs-ds .nav-link {
        padding: var(--space-3) var(--space-4);
        font-size: var(--font-size-sm);
    }
    
    /* Tables - Scroll horizontally */
    .table-ds-container {
        overflow-x: auto;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-3 { gap: var(--space-3); }
