/* ==========================================
   CRANES PAGE STYLES - HORIZONTAL LAYOUT
   ========================================== */

/* Page Header - tylko tlo strony zurawie (struktura wspolna w main.css) */
.page-header-bg {
    background-image: url('../img/top/Zurawie.jpg');
}

/* Filter Section */
.cranes-filter {
    background: var(--bg-light);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--bg-gray);
    position: sticky;
    top: 70px;
    z-index: 100;
}

.filter-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.filter-info h2 {
    font-family: var(--font-primary);
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.filter-info p {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.filter-buttons {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.85rem;
    border: 2px solid var(--bg-gray);
    border-radius: var(--radius-full);
    background: var(--bg-white);
    color: var(--text-gray);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
    color: var(--text-dark);
}

/* Cranes Section */
.cranes-section {
    padding: var(--spacing-lg) 0;
    background: var(--bg-white);
}

.cranes-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* ==========================================
   HORIZONTAL CRANE ROW
   ========================================== */

.crane-row {
    display: flex;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    border: 2px solid transparent;
}

.crane-row:hover {
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
    transform: translateX(5px);
}

/* Crane Image */
.crane-row .crane-image {
    position: relative;
    width: 320px;
    min-width: 320px;
    height: 240px;
    overflow: hidden;
    flex-shrink: 0;
}

.crane-row .crane-image > img:not(.crane-logo) {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.crane-row:hover .crane-image > img:not(.crane-logo) {
    transform: scale(1.08);
}

.crane-row .crane-logo {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    height: 30px;
    width: auto;
    max-width: 80px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    background: var(--bg-white);
    padding: 3px;
    object-fit: contain;
}

/* Crane Details */
.crane-details {
    flex: 1;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.crane-header {
    margin-bottom: var(--spacing-sm);
}

.crane-name {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.crane-desc {
    color: var(--text-gray);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Specs Row */
.crane-specs-row {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.spec-box {
    flex: 1;
    min-width: 100px;
    padding: var(--spacing-sm);
    background: var(--bg-light);
    border-radius: var(--radius-md);
    text-align: center;
    transition: var(--transition-fast);
}

.spec-box:hover {
    background: var(--bg-gray);
}

.spec-box .spec-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.spec-box .spec-value {
    display: block;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Crane Actions */
.crane-actions {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.btn-details,
.btn-pdf,
.btn-order {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.btn-details svg,
.btn-pdf svg,
.btn-order svg {
    width: 16px;
    height: 16px;
}

.btn-details {
    background: var(--secondary-color);
    color: var(--text-light);
    border: none;
}

.btn-details:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-details svg {
    stroke: var(--text-light);
}

.btn-pdf {
    background: transparent;
    color: var(--text-gray);
    border-color: var(--bg-gray);
}

.btn-pdf:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-pdf svg {
    stroke: currentColor;
}

.btn-order {
    background: var(--gradient-primary);
    color: var(--text-dark);
}

.btn-order:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-order svg {
    stroke: var(--text-dark);
}

/* ==========================================
   MODAL STYLES
   ========================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    padding: var(--spacing-md);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    display: none;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
}

.modal.active {
    display: block;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transform: translateY(30px);
    transition: transform var(--transition-normal);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-header {
    position: relative;
    padding: var(--spacing-lg) var(--spacing-md);
    background: var(--gradient-secondary);
    color: var(--text-light);
    text-align: center;
}

.modal-header h2 {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.modal-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

.modal-body {
    padding: var(--spacing-md);
}

.specs-table-wrapper {
    overflow-x: auto;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-secondary);
}

.specs-table th,
.specs-table td {
    padding: 12px 16px;
    text-align: center;
    border-bottom: 1px solid var(--bg-gray);
}

.specs-table thead {
    background: var(--bg-light);
}

.specs-table th {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.specs-table tbody tr:hover {
    background: var(--bg-light);
}

.specs-table td:first-child {
    font-weight: 600;
    color: var(--text-dark);
}

.specs-table td:last-child {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.modal-footer {
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
    display: flex;
    gap: var(--spacing-xs);
    justify-content: center;
}

.modal-footer .btn-primary,
.modal-footer .btn-outline {
    flex: 1;
    text-align: center;
    padding: 12px 20px;
    font-size: 0.9rem;
}

/* ==========================================
   RESPONSIVE STYLES
   ========================================== */

@media (max-width: 900px) {
    .crane-row {
        flex-direction: column;
    }

    .crane-row .crane-image {
        width: 100%;
        min-width: 100%;
        height: 200px;
    }

    .crane-row:hover {
        transform: translateY(-5px);
    }

    .filter-wrapper {
        flex-direction: column;
        text-align: center;
    }

    .filter-buttons {
        justify-content: center;
    }

    .cranes-filter {
        position: static;
    }
}

@media (max-width: 600px) {
    .crane-specs-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

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

    .btn-details,
    .btn-pdf,
    .btn-order {
        width: 100%;
        justify-content: center;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn-primary,
    .modal-footer .btn-outline {
        width: 100%;
    }

    .filter-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .crane-name {
        font-size: 1.3rem;
    }
}

/* Animation for rows appearing */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.crane-row {
    animation: slideInLeft 0.5s ease forwards;
}

.crane-row:nth-child(2) { animation-delay: 0.05s; }
.crane-row:nth-child(3) { animation-delay: 0.1s; }
.crane-row:nth-child(4) { animation-delay: 0.15s; }
.crane-row:nth-child(5) { animation-delay: 0.2s; }
.crane-row:nth-child(6) { animation-delay: 0.25s; }
.crane-row:nth-child(7) { animation-delay: 0.3s; }
.crane-row:nth-child(8) { animation-delay: 0.35s; }

/* Hidden state for filtering */
.crane-row.hidden {
    display: none;
}

/* Highlight animation for direct link */
.crane-row.highlight {
    animation: highlightPulse 2s ease;
}

@keyframes highlightPulse {
    0%, 100% {
        box-shadow: var(--shadow-md);
        border-color: transparent;
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
        border-color: var(--primary-color);
    }
}
