/**
 * AutoM - Alap stílusok
 * Mobile-first, reszponzív design
 */

/* =====================================================
   CSS VÁLTOZÓK
   ===================================================== */
:root {
    --sidebar-width: 260px;
    --sidebar-bg: linear-gradient(180deg, #4a90d9 0%, #1a1a2e 100%);
    --sidebar-text: #ffffff;
    --sidebar-active: #ffffff;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.2);
    --primary-color: #4a90d9;
    --danger-color: #dc3545;
}

/* =====================================================
   ALAPOK
   ===================================================== */
html {
    height: 100%;
}

body {
    min-height: 100%;
    background-color: #f8f9fa;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
    background: var(--sidebar-bg);
    width: var(--sidebar-width);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 1.75rem 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
}

.sidebar-header a {
    color: var(--sidebar-active);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.sidebar-header .logo-img {
    max-width: 100%;
    height: auto;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sidebar-header span {
    font-size: 0.95rem;
    font-weight: 600;
}

/* =====================================================
   MOBIL HEADER
   ===================================================== */
.mobile-header {
    background: linear-gradient(135deg, #4a90d9 0%, #1a1a2e 100%);
}

.mobile-header-offcanvas {
    background: linear-gradient(135deg, #4a90d9 0%, #1a1a2e 100%);
}

.mobile-logo {
    max-width: 30px;
    height: auto;
}

.mobile-header .navbar-brand {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    transition: all 0.3s ease;
    border-radius: 0;
    margin: 0.15rem 0.75rem;
    border-radius: 0.5rem;
}

.sidebar .nav-link:hover {
    background-color: var(--sidebar-hover-bg);
    color: var(--sidebar-active);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    color: var(--sidebar-active);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link i {
    font-size: 1.2rem;
    width: 1.75rem;
    text-align: center;
}

.sidebar .nav-link .badge {
    margin-left: auto;
    background: #ff6b6b !important;
    font-weight: 600;
}

.nav-divider {
    border-color: rgba(255, 255, 255, 0.15);
    margin: 1rem 1.5rem;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.75rem 0;
    margin-top: auto;
}

.sidebar-footer .nav-link {
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-footer .nav-link:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content {
    min-height: 100vh;
}

/* =====================================================
   KÁRTYÁK
   ===================================================== */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.card-auto {
    border-left: 4px solid var(--primary-color);
}

.card-szerviz {
    border-left: 4px solid #198754;
}

.card-javitas {
    border-left: 4px solid #fd7e14;
}

/* =====================================================
   GOMBOK
   ===================================================== */
.btn {
    min-height: 44px;
    min-width: 44px;
}

.btn-primary {
    background-color: #4a90d9;
    border-color: #4a90d9;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #3b7fc7;
    border-color: #3b7fc7;
}

.btn-outline-primary {
    color: #4a90d9;
    border-color: #4a90d9;
}

.btn-outline-primary:hover {
    background-color: #4a90d9;
    border-color: #4a90d9;
    color: white;
}

.btn-icon {
    padding: 0.5rem;
    line-height: 1;
}

/* =====================================================
   FORM ELEMEK
   ===================================================== */
.form-control,
.form-select {
    min-height: 44px;
}

.form-control:focus,
.form-select:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 0.25rem rgba(74, 144, 217, 0.25);
}

.form-label {
    font-weight: 500;
}

/* =====================================================
   ÜRES ÁLLAPOT
   ===================================================== */
.ures-allapot {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.ures-allapot i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.ures-allapot h5 {
    margin-bottom: 1rem;
}

/* =====================================================
   STATISZTIKÁK (Dashboard)
   ===================================================== */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
}

.stat-card .stat-label {
    font-size: 0.875rem;
}

/* =====================================================
   TÁBLÁZATOK
   ===================================================== */
.table th {
    font-weight: 600;
    background-color: #f8f9fa;
}

/* =====================================================
   BADGE-EK
   ===================================================== */
.badge-tulajdonos {
    background-color: #198754;
}

.badge-szerkeszto {
    background-color: #4a90d9;
    color: #fff;
}

.badge-fuggoben {
    background-color: #ffc107;
    color: #000;
}

.badge-elfogadva {
    background-color: #198754;
}

.badge-elutasitva {
    background-color: #dc3545;
}

/* =====================================================
   JOGOSULTSÁG BADGE
   ===================================================== */
.jogosultsag-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* =====================================================
   MOBILE (alapértelmezett)
   ===================================================== */

/* Offcanvas sidebar mobilon */
.offcanvas-lg {
    width: var(--sidebar-width);
}

/* =====================================================
   TABLET ÉS FEL (768px+)
   ===================================================== */
@media (min-width: 768px) {
    .ures-allapot {
        padding: 4rem 2rem;
    }
}

/* =====================================================
   DESKTOP (992px+)
   ===================================================== */
@media (min-width: 992px) {
    /* Fix sidebar desktop-on */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 100;
    }

    /* Main content eltolása */
    .main-content {
        margin-left: var(--sidebar-width);
    }

    /* Kártya grid */
    .card-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

/* =====================================================
   NAGY KÉPERNYŐK (1400px+)
   ===================================================== */
@media (min-width: 1400px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

/* =====================================================
   TÖRLÉS MEGERŐSÍTÉS MODAL
   ===================================================== */
.modal-torles .modal-header {
    background-color: var(--danger-color);
    color: white;
}

/* =====================================================
   AUTOCOMPLETE
   ===================================================== */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-results.show {
    display: block;
}

.autocomplete-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
}

.autocomplete-item:hover {
    background-color: #f8f9fa;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

/* =====================================================
   ALKATRÉSZ SOR (dinamikus form)
   ===================================================== */
.alkatresz-sor {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.alkatresz-sor .btn-torol-alkatresz {
    color: var(--danger-color);
}

/* =====================================================
   SZÁMLAKÉP ELŐNÉZET
   ===================================================== */
.szamla-preview {
    max-width: 200px;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
}

/* =====================================================
   PAGE HEADER
   ===================================================== */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .page-header h1 {
        font-size: 1.75rem;
    }
}

/* =====================================================
   ACTION BUTTONS
   ===================================================== */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Modern action buttons */
.action-buttons-modern {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 1rem;
}

.action-btn-view {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.action-btn-view:hover {
    background: #0d6efd;
    color: white;
    transform: scale(1.1);
}

.action-btn-edit {
    background: rgba(74, 144, 217, 0.1);
    color: #4a90d9;
}

.action-btn-edit:hover {
    background: #4a90d9;
    color: white;
    transform: scale(1.1);
}

.action-btn-invite {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.action-btn-invite:hover {
    background: #198754;
    color: white;
    transform: scale(1.1);
}

.action-btn-delete {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.action-btn-delete:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
}

/* =====================================================
   RENDSZÁMTÁBLA STÍLUS
   ===================================================== */
.rendszam-tabla {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #1a1a2e;
    border-radius: 6px;
    padding: 4px 20px;
    min-width: 100px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rendszam-text {
    font-family: 'Arial Black', Arial, sans-serif;
    font-weight: 900;
    font-size: 0.9rem;
    letter-spacing: 1px;
    color: #1a1a2e;
    text-transform: uppercase;
}

.csavar {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #1a1a2e;
    border-radius: 50%;
}

.csavar-tl { top: 4px; left: 6px; }
.csavar-tr { top: 4px; right: 6px; }
.csavar-bl { bottom: 4px; left: 6px; }
.csavar-br { bottom: 4px; right: 6px; }

/* =====================================================
   MÁSOLÁS GOMB
   ===================================================== */
.btn-copy {
    background: none;
    border: none;
    color: #6c757d;
    padding: 2px 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin-left: 4px;
}

.btn-copy:hover {
    color: #4a90d9;
    background: rgba(74, 144, 217, 0.1);
}

.btn-copy.copied {
    color: #198754;
}

.btn-copy.copied i::before {
    content: "\f633";
}

/* =====================================================
   AUTÓ LOGO ÉS KÉP
   ===================================================== */
.auto-logo {
    width: 100px;
    height: 100px;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 0.75rem;
}

.auto-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.auto-logo.has-photo {
    padding: 0.25rem;
}

.auto-logo.has-photo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
}

.auto-logo-small {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0.25rem;
}

.auto-logo-medium {
    width: 70px;
    height: 70px;
    min-width: 70px;
    padding: 0.25rem;
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .action-buttons,
    .action-buttons-modern {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }
}
