/* Minimal Ergonomic Design for Hajókereskedés */

:root {
    /* Modern, calming color palette */
    --primary: #0066cc;
    --primary-light: #3388dd;
    --primary-dark: #004a99;
    --accent: #00b894;
    --text: #2d3436;
    --text-light: #636e72;
    --text-lighter: #b2bec3;
    --bg: #ffffff;
    --bg-gray: #f8f9fa;
    --bg-light: #fafbfc;
    --border: #e1e4e8;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --spacing: 8px;

    /* Alias variables for compatibility with other pages */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #fafbfc;
    --color-bg-tertiary: #f8f9fa;
    --color-bg-white: #ffffff;
    --color-bg-hover: #f8f9fa;
    --color-bg-active: #e1e4e8;
    --color-text-primary: #2d3436;
    --color-text-secondary: #636e72;
    --color-text-tertiary: #b2bec3;
    --color-text-muted: #b2bec3;
    --color-text-accent: #0066cc;
    --color-text-success: #00b894;
    --color-text-error: #dc2626;
    --color-border-primary: #e1e4e8;
    --color-border-secondary: #d1d5db;
    --color-accent-primary: #0066cc;
    --color-accent-secondary: #004a99;

    /* Spacing variables */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Font sizes */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 0.9375rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    /* Font weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Font families */
    --font-family-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-family-serif: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-family-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Oxygen, Ubuntu, sans-serif;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-light);
    font-size: 16px;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header - Clean & Minimal */
.header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
}

.navbar {
    padding: 20px 24px;
    max-width: 1400px;
    width: 100%;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    width: 100%;
    position: relative;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    gap: 32px;
    align-items: center;
    list-style: none;
    justify-content: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-auth {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 12px;
}

.nav-logout-form {
    display: flex;
    align-items: center;
    margin: 0;
}

.nav-link {
    padding: 10px 16px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.2s;
    font-size: 15px;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--bg-gray);
}

.nav-link.active {
    color: var(--primary);
    background: var(--bg-gray);
}

/* Language Switch - Aligned with nav menu */
.language-switch {
    display: flex;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    padding: 4px;
    align-self: center;
    position: absolute;
    right: 0;
}

.lang-btn {
    background: none;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-light);
}

.lang-btn.active {
    background: var(--bg);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.lang-btn:hover:not(.active) {
    color: var(--text);
}

/* Hero - Simplified */
.hero {
    text-align: center;
    padding: 20px 0 6px;
    background: var(--bg);
    max-width: 70%;
    margin: 0 auto;
}

.hero h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 16px;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Page Headers - Consistent across all pages */
.dealers-header,
.manufacturers-header,
.post-ad-header {
    text-align: center;
    padding: 40px 0 24px;
    background: var(--bg);
    max-width: 70%;
    margin: 0 auto 32px;
}

.dealers-header h2,
.manufacturers-header h2,
.post-ad-header h2 {
    font-size: 32px !important;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px !important;
    letter-spacing: -1px;
}

.dealers-header p,
.manufacturers-header p,
.post-ad-header p {
    font-size: 16px !important;
    color: var(--text-light);
}

/* Page Sections - Centered like main page */
.dealers-section,
.manufacturers-section {
    max-width: 70%;
    margin: 0 auto;
}

.dealers-grid,
.manufacturers-grid {
    margin-bottom: 40px;
}

/* Detail Pages - Centered like main page */
.manufacturer-detail-container,
.dealer-detail-container {
    max-width: 70%;
    margin: 0 auto;
}

.manufacturer-header,
.dealer-header {
    max-width: 100%;
    margin: 0 auto 32px;
}

.back-button {
    max-width: 70%;
    margin: 0 auto 16px;
}

/* Filters - Compact & Responsive */
.filters {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    max-width: 70%;
    margin-left: auto;
    margin-right: auto;
}

.filter-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 12px;
    margin-bottom: 4px;
    font-weight: 500;
    color: var(--text);
}

.form-select,
.form-input {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text);
    background: var(--bg);
    transition: all 0.2s;
    font-family: inherit;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

.form-select::placeholder,
.form-input::placeholder {
    color: var(--text-lighter);
}

/* Responsive filters */
@media (max-width: 768px) {
    .filters {
        max-width: 95%;
        padding: 12px;
    }

    .filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
    }

    .form-select,
    .form-input {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Advanced Search Toggle */
.advanced-search-toggle {
    text-align: center;
    margin: 20px 0;
}

.advanced-search-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.advanced-search-link:hover {
    background: var(--bg-gray);
}

.advanced-filters {
    margin-top: 20px;
}

/* Filter Actions */
.filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}

/* Buttons - Modern & Minimal */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-family: inherit;
}

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

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

.btn-secondary {
    background: var(--bg-gray);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--border);
}

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

.btn-success:hover {
    background: #00a180;
}

/* Ad Grid - Spacious & Clean */
.ads-section {
    margin-top: 16px;
    max-width: 70%;
    margin-left: auto;
    margin-right: auto;
}

.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 40px;
}

/* Ad Card - Elegant & Minimal */
.ad-card {
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    cursor: pointer;
    border: 1px solid transparent;
    margin: 4px;
}

.ad-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border);
}

.ad-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--bg-gray);
}

.ad-content {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ad-title {
    font-family: var(--font-family-display) !important;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    /* Limit to 1 line with ellipsis */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-price {
    font-family: var(--font-family-display) !important;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.ad-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-light);
    font-size: 13px;
    /* Limit to 2 lines total */
    max-height: 2.6em;
    overflow: hidden;
}

.ad-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pagination - Simple */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.pagination button {
    padding: 10px 16px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 15px;
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-gray);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Footer - Minimal */
.footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 60px;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero,
    .dealers-header,
    .manufacturers-header,
    .post-ad-header,
    .manufacturer-header,
    .dealer-header {
        max-width: 95%;
        padding: 24px 0 16px;
    }

    .hero h1,
    .dealers-header h2,
    .manufacturers-header h2,
    .post-ad-header h2,
    .manufacturer-header h1,
    .dealer-header h1 {
        font-size: 24px !important;
    }

    .hero p,
    .dealers-header p,
    .manufacturers-header p,
    .post-ad-header p {
        font-size: 14px !important;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .ads-section,
    .dealers-section,
    .manufacturers-section,
    .manufacturer-detail-container,
    .dealer-detail-container,
    .back-button {
        max-width: 95%;
    }

    .ads-grid,
    .dealers-grid,
    .manufacturers-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }

    .filter-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-gray);
    color: var(--text-light);
}

.badge.active {
    background: #d1f4e0;
    color: #00b894;
}

.badge.pending {
    background: #fff4e6;
    color: #e67e22;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text);
}

.empty-state p {
    font-size: 16px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.modal[style*="display: block"] {
    display: flex !important;
}

.modal-content {
    background: var(--bg);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
    background: var(--bg-gray);
}

.modal-body {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    transition: all 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
}

.success-message {
    background: #efe;
    color: #3a3;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
}

/* Compact page layouts (post-ad, dashboard, etc.) */
.post-ad-container,
.dashboard-container,
.admin-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.post-ad-form,
.auth-required {
    max-width: 800px;
    margin: 0 auto;
}

/* Compact form sections */
.form-section {
    margin-bottom: 24px !important;
    padding-bottom: 20px !important;
}

.form-section h3 {
    font-size: 18px !important;
    margin-bottom: 16px !important;
}

.form-row {
    gap: 16px !important;
    margin-bottom: 16px !important;
}

.form-group {
    margin-bottom: 16px !important;
}

.form-group label {
    font-size: 14px !important;
    margin-bottom: 6px !important;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 10px 14px !important;
    font-size: 14px !important;
}

.form-group textarea {
    min-height: 80px !important;
}

/* Compact headers */
.post-ad-header,
.dashboard-header {
    padding: 20px !important;
    margin-bottom: 24px !important;
}

.post-ad-header h2,
.dashboard-header h2 {
    font-size: 28px !important;
    margin-bottom: 8px !important;
}

.post-ad-header p,
.dashboard-header p {
    font-size: 15px !important;
}

/* Dealer and Manufacturer cards - match ad-card size */
.dealers-grid,
.manufacturers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 40px;
}

.dealer-card,
.manufacturer-card {
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    cursor: pointer;
    border: 1px solid transparent;
    margin: 5px;
}

.dealer-card:hover,
.manufacturer-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border);
}

.dealer-image,
.manufacturer-image {
    width: 100%;
    height: 160px;
    object-fit: contain;
    background: var(--bg-gray);
}

.dealer-content,
.manufacturer-content {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dealer-name,
.manufacturer-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dealer-location,
.manufacturer-country {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Registration Dropdown */
.register-dropdown {
    position: relative;
    display: inline-block;
}

.register-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg);
    min-width: 250px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-sm);
    z-index: 1000;
    margin-top: 8px;
    border: 1px solid var(--border);
}

.register-dropdown-content button {
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: all 0.2s;
    font-family: inherit;
}

.register-dropdown-content button:hover {
    background-color: var(--bg-gray);
}

.register-dropdown-content button:first-child {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.register-dropdown-content button:last-child {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.register-dropdown.show .register-dropdown-content {
    display: block;
}
