/* RZECZYWOJTKA - Główne style */

:root {
    --primary-color: #4CAF50;
    --primary-dark: #45a049;
    --secondary-color: #2196F3;
    --text-dark: #333;
    --text-light: #666;
    --text-muted: #999;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-dark);
}

.logo-img {
    max-width: 70px;
    max-height: 70px;
    width: auto;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.main-nav {
    display: flex;
    gap: 30px;
    flex: 1;
    justify-content: center;
}

.header-search {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.header-search-form {
    display: flex;
    gap: 0;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    background: var(--bg-white);
}

.header-search-input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    font-size: 14px;
    outline: none;
}

.header-search-input:focus {
    border-color: var(--primary-color);
}

.header-search-btn {
    padding: 8px 12px;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.header-search-btn:hover {
    background: var(--primary-dark);
}

.user-info-header {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-dark);
}

.user-name-header {
    white-space: nowrap;
    font-weight: 500;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

.nav-item-dropdown {
    position: relative;
    display: inline-block;
}

.nav-item-dropdown .nav-link {
    display: block;
    cursor: pointer;
}

.categories-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 280px;
    max-width: 400px;
    max-height: 600px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10000;
    padding: 10px 0;
    border: 1px solid var(--border-color);
}

.nav-item-dropdown:hover .categories-dropdown,
.categories-dropdown:hover {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
}

.categories-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

.category-group {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.category-group:last-child {
    border-bottom: none;
}

.category-group-title {
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-light);
    margin-bottom: 5px;
}

.category-group-items {
    padding: 5px 0;
}

.category-dropdown-item {
    display: block;
    padding: 10px 20px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.category-dropdown-item:hover {
    background: rgba(76, 175, 80, 0.1);
    color: var(--primary-color);
    padding-left: 25px;
}

.category-dropdown-item.all-link {
    font-weight: 600;
    color: var(--primary-color);
    border-top: 1px solid var(--border-color);
    margin-top: 5px;
    padding-top: 12px;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Language Selector */
.language-selector {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.lang-btn:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
}

.flag-icon {
    font-size: 20px;
    line-height: 1;
}

.flag-icon-img {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    display: inline-block;
    vertical-align: middle;
}

.lang-code {
    font-weight: 600;
    color: var(--text-dark);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 1000;
}

.lang-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-dark);
    transition: background 0.3s;
    border-radius: 8px 8px 0 0;
}

.lang-option:last-child {
    border-radius: 0 0 8px 8px;
}

.lang-option:hover {
    background: var(--bg-light);
}

.lang-option.active {
    background: rgba(76, 175, 80, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    transition: all 0.3s;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-search {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
}

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

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

.btn-secondary {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

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

.btn-search {
    background: var(--secondary-color);
    color: white;
    padding: 12px 30px;
}

.btn-search:hover {
    background: #1976D2;
}


/* Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    position: relative;
    padding: 30px 0;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="sparks" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23sparks)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.hero-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Main Content */
.main-content {
    padding: 40px 0;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text-dark);
}

/* Machines Grid */
.machines-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 60px;
}

.machines-grid.list-view {
    grid-template-columns: 1fr;
}

.machines-grid.list-view .machine-card {
    display: flex;
    flex-direction: row;
    max-width: 100%;
}

.machines-grid.list-view .machine-image {
    width: 300px;
    flex-shrink: 0;
}

.machines-grid.list-view .machine-info {
    flex: 1;
    padding: 20px;
}

.machine-card {
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.machine-card:hover {
    box-shadow: var(--shadow-hover);
}

.machine-image {
    width: 100%;
    aspect-ratio: 1;
    background: #ffffff;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.machine-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.stock-badge-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    padding: 6px 12px;
    background: rgba(76, 175, 80, 0.95);
    color: white;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.machine-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.machine-actions {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
    padding-top: 20px;
    margin-bottom: 0;
}

.btn-call {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 6px rgba(33, 150, 243, 0.25);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-call::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-call:hover {
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    box-shadow: 0 6px 12px rgba(33, 150, 243, 0.35);
    transform: translateY(-1px);
}

.btn-call:hover::before {
    left: 100%;
}

.btn-call:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.25);
}

.machine-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.machine-model {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.machine-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.machine-location {
    font-size: 14px;
    color: var(--text-muted);
}

.machine-location::before {
    content: "📍 ";
}

.machine-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.category-card {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    color: var(--primary-color);
}

.category-name {
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.empty-state p {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Footer */
.main-footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3, .footer-section h4 {
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

/* Responsive */
@media (max-width: 1200px) {
    .machines-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .machines-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .machines-grid {
        grid-template-columns: 1fr;
    }
    
    .listings-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .main-nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        background: var(--bg-white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow);
        transition: left 0.3s;
    }

    .main-nav.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .header-search {
        order: 3;
        max-width: 100%;
        margin: 10px 0 0 0;
        width: 100%;
    }

    .header-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .language-selector {
        order: -1;
    }
    
    .lang-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .lang-code {
        display: none;
    }
    
    .lang-dropdown {
        right: auto;
        left: 0;
    }

    .user-info-header {
        order: 2;
        width: 100%;
        text-align: center;
        font-size: 12px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-stats {
        flex-direction: column;
        gap: 15px;
    }

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

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .logo h1 {
        font-size: 18px;
    }

    .section-title {
        font-size: 20px;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        gap: 15px;
    }

    .header-search {
        order: 2;
    }

    .header-actions {
        order: 1;
        width: 100%;
        justify-content: space-between;
    }

    .user-name-header {
        font-size: 11px;
    }

    .btn-secondary {
        padding: 8px 12px;
        font-size: 12px;
    }
}

