/* === Header Styles === */
header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    background: transparent;
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 32px;
    font-weight: bold;
    color: #1a2c62;
}

.logo span {
    color: #019d50;
}

.header-logo-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    object-position: center;
    flex-shrink: 0;
    clip-path: inset(2px 2px);
}

.logo-with-icon {
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* === Buttons Styles === */
.btn-secondary {
    background-color: #019d50;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    opacity: 0.9;
}

.btn-telegram {
    background-color: #1a2c62;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
}

.btn-telegram:hover {
    opacity: 0.9;
}

#mobileAuthModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

#mobileAuthModal.active {
    display: flex;
}

body.modal-open {
    overflow: hidden;
}

#mobileAuthModal .modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    width: calc(100% - 40px);
    position: relative;
    text-align: center;
}

#mobileAuthModal .modal-close {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    background: none;
    border: none;
}

#mobileAuthModal .modal-close:hover {
    color: #000;
}

#mobileAuthModal .modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

#mobileAuthModal p {
    text-align: center;
    margin: 0 20px 20px;
    color: #333;
}

.modal-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

#mobileAuthModal .header-logo-icon {
    width: 40px;
    height: 40px;
}

#mobileAuthModal .logo {
    margin-left: 10px;
}

#mobileAuthModal .logo span:first-child {
    color: #1a2c62;
}

/* === Header Media Queries === */
@media (max-width: 768px) {
    header {
        padding: 15px 20px;
    }
    .logo {
        font-size: 24px;
    }
}

/* ==== Animations ==== */
@keyframes lb-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==== Contacts Section ==== */
.contacts-section {
    margin-top: 1rem;
}

.contacts-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    margin: 0 0 0.75rem 0;
}

.current-contacts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 13px;
}

.contact-label {
    color: #555;
    font-weight: 500;
}

.contact-value {
    color: var(--tg-theme-text-color);
}

/* ==== Bid Buttons ==== */
.bids-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    margin: 0 0 1rem 0;
    text-align: center;
}

.bid-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.btn-bid {
    background-color: #019d50;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
}

.btn-bid:hover {
    background-color: #388E3C;
    opacity: 0.95;
}

.btn-bid:active {
    transform: scale(0.98);
}

/* ==== Form Placeholder ==== */
.form-placeholder {
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form sections styling */
.form-placeholder h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--tg-theme-border-color);
}

.form-placeholder .form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.form-placeholder .form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-placeholder .form-group label {
    font-size: 12px;
    font-weight: 500;
    color: #555;
}

.form-placeholder .form-group input,
.form-placeholder .form-group select {
    padding: 9px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.2s;
    background-color: #fff;
}

.form-placeholder .form-group input {
    cursor: auto;
}

.form-placeholder .form-group select {
    cursor: pointer;
}

.form-placeholder .form-group input:focus,
.form-placeholder .form-group select:focus {
    outline: none;
    border-color: #019d50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.form-placeholder textarea {
    padding: 9px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.2s;
    background-color: #fff;
    resize: vertical;
    min-height: 80px;
}

.form-placeholder textarea:focus {
    outline: none;
    border-color: #019d50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.form-placeholder .form-actions {
    margin-top: 1rem;
}

.bid-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

/* ==== Bids Section ==== */
.bids-section {
    margin-top: 1.5rem;
}

.bids-container {
    margin-top: 1rem;
}

.bids-mobile-list {
    display: none;
}

.bids-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bids-table th,
.bids-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--tg-theme-border-color);
}

.bids-table th {
    background-color: var(--tg-theme-bg-color);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--tg-theme-hint-color);
}

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

.bids-table .empty-row td {
    text-align: center;
    color: var(--tg-theme-hint-color);
    font-style: italic;
    padding: 2rem;
}

.bids-table .td-details {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bids-mobile-list .empty-message {
    text-align: center;
    color: var(--tg-theme-hint-color);
    font-style: italic;
    padding: 2rem;
}

.bids-mobile-list .bid-card {
    background-color: var(--tg-theme-secondary-bg-color);
    border: 1px solid var(--tg-theme-border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bids-mobile-list .bid-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bids-mobile-list .bid-type {
    font-size: 14px;
    font-weight: bold;
    color: #000;
}

.bids-mobile-list .bid-date {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

.bids-mobile-list .bid-status {
    font-size: 12px;
    color: var(--tg-theme-text-color);
}

.bids-mobile-list .bid-details {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==== Status Colors ==== */
.status-pending {
    color: #ff9800;
}

.status-approved {
    color: #4caf50;
}

.status-rejected {
    color: #f44336;
}

.status-completed {
    color: #2196f3;
}

/* ==== Telegram Theme Integration ==== */
:root {
    --bid-btn-bg: #1a2c62;
    --bid-btn-hover: #0f1a3a;
}

/* === Color Selector === */
.color-selector {
    position: relative;
    margin-top: 4px;
}

.color-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.color-button:hover {
    border-color: #019d50;
}

.color-preview-box {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid #ccc;
    flex-shrink: 0;
    background-color: transparent;
}

.color-text {
    flex: 1;
}

.color-arrow {
    font-size: 10px;
    color: #999;
    transition: transform 0.2s;
}

.color-button.open .color-arrow {
    transform: rotate(180deg);
}

.color-palette {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 8px;
    animation: lb-fade 0.2s ease;
}

.color-palette.closing {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.color-option {
    aspect-ratio: 1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    position: relative;
}

.color-option:hover {
    transform: scale(1.05);
    border-color: #019d50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-option.selected {
    border-color: #019d50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.color-option::after {
    content: attr(data-name);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 101;
}

.color-option:hover::after {
    opacity: 1;
}

.color-option[data-color="white"],
.color-option[data-color="silver"],
.color-option[data-color="beige"],
.color-option[data-color="light-blue"] {
    border: 2px solid #ddd;
}

/* ==== Desktop Layout ==== */
@media (min-width: 769px) {
    .current-contacts {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .contact-item {
        display: flex;
        flex-direction: row;
    }
    
    .form-actions {
        gap: 1rem;
    }
    
    .form-actions .btn-cancel,
    .form-actions .btn-submit {
        flex: 1;
        max-width: 200px;
    }
}

/* ==== Mobile Layout ==== */
@media (max-width: 768px) {
    .bid-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .btn-bid {
        min-width: 160px;
        padding: 14px 20px;
    }
    
    .form-placeholder .form-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .form-placeholder .form-group {
        flex: 0 0 calc(50% - 5px);
        min-width: 0;
        box-sizing: border-box;
    }
    

    
    .bids-table {
        display: none;
    }
    
    .bids-mobile-list {
        display: block;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ==== Tablet Layout ==== */
@media (min-width: 769px) and (max-width: 1024px) {
    .bid-buttons {
        flex-wrap: wrap;
    }
    
    .btn-bid {
        min-width: 180px;
    }
}

/* Consent Checkboxes */
.form-group.consent-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--tg-theme-border-color);
}

.consent-checkbox-item {
    display: block;
}

.consent-checkbox-item label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
    color: var(--tg-theme-text-color);
}

.consent-checkbox-item label:hover {
    color: #1a2c62;
}

.consent-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #019d50;
    cursor: pointer;
    flex-shrink: 0;
}

.consent-checkbox-item span {
    flex: 1;
}

.consent-checkbox-item a {
    color: #019d50;
    text-decoration: none;
}

.consent-checkbox-item a:hover {
    text-decoration: underline;
}

/* ==== Bid Success Modal ==== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    color: #333;
}

.modal-content h3 {
    text-align: center;
    margin: 0 0 1.5rem 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.modal-content p {
    text-align: left;
    margin: 0 0 1rem 0;
    font-size: 14px;
    line-height: 1.5;
    color: #4a4a4a;
}

.modal-content #continueBtn {
    display: block;
    margin: 1.5rem auto 0;
    width: auto;
}
