/* 
 * Toun+ B2B Chess Grid & Sidebar Styles
 * Adhering strictly to Houzez theme styling:
 * Font: Jost
 * Colors: Primary: #a89d74, Secondary: #088c98, Text: #222222, Bg: #f7f8f9
 */

#toun-chess-container {
    font-family: "Jost", sans-serif;
    color: #222222;
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin: 20px 0;
}

.toun-chess-loader {
    text-align: center;
    padding: 50px;
    font-size: 18px;
    color: #a89d74;
}

/* Tabs for Sections/Entrances */
.toun-chess-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 30px;
    padding-bottom: 10px;
    overflow-x: auto;
}

.toun-chess-tab {
    padding: 10px 24px;
    font-weight: 500;
    font-size: 15px;
    color: #666666;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.toun-chess-tab:hover {
    color: #a89d74;
}

.toun-chess-tab.active {
    color: #a89d74;
    border-bottom-color: #a89d74;
}

/* Chess Grid Wrapper */
.toun-chess-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 15px;
}

/* Row (Floor) styling */
.toun-chess-row {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: max-content;
}

.toun-chess-floor-label {
    width: 60px;
    font-weight: 600;
    font-size: 14px;
    color: #888888;
    text-align: right;
    padding-right: 10px;
}

.toun-chess-cells {
    display: flex;
    gap: 8px;
}

/* Cell (Apartment) styling */
.toun-chess-cell {
    width: 85px;
    height: 60px;
    border-radius: 4px;
    border: 1px solid #dce0e0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    padding: 5px;
}

.toun-chess-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.toun-chess-cell-num {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.toun-chess-cell-info {
    font-size: 10px;
    opacity: 0.8;
}

/* Colors based on Booking Status */
.toun-chess-cell.free {
    background-color: #f0fbf2;
    border-color: #2ecc71;
    color: #27ae60;
}
.toun-chess-cell.free:hover {
    background-color: #e2f9e6;
}

.toun-chess-cell.reserved {
    background-color: #fff9e6;
    border-color: #f39c12;
    color: #d35400;
}
.toun-chess-cell.reserved:hover {
    background-color: #fff1cc;
}

.toun-chess-cell.sold {
    background-color: #f5f5f5;
    border-color: #d2d2d2;
    color: #777777;
    cursor: not-allowed;
}
.toun-chess-cell.sold:hover {
    transform: none;
    box-shadow: none;
}

/* Sidebar Overlay */
.toun-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Sidebar panel */
.toun-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 420px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 100000;
    transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

.toun-sidebar.active {
    right: 0;
}

.toun-sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toun-sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #222222;
}

.toun-sidebar-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #888888;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.toun-sidebar-close:hover {
    color: #a89d74;
}

/* Sidebar Content body */
.toun-sidebar-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.toun-sidebar-price {
    font-size: 24px;
    font-weight: 700;
    color: #a89d74;
    margin-bottom: 15px;
}

.toun-sidebar-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.toun-sidebar-meta-item {
    background: #f7f8f9;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
}

.toun-sidebar-meta-label {
    color: #888888;
    margin-bottom: 2px;
}

.toun-sidebar-meta-val {
    font-weight: 600;
}

/* Commission Section (B2B) */
.toun-sidebar-b2b {
    background: #eef9f0;
    border: 1px solid #2ecc71;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.toun-sidebar-b2b-label {
    color: #27ae60;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}

.toun-sidebar-b2b-value {
    font-size: 20px;
    font-weight: 700;
    color: #27ae60;
}

/* AI Smart fields */
.toun-sidebar-section {
    margin-top: 25px;
}

.toun-sidebar-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 5px;
}

.toun-sidebar-ai-text {
    font-size: 14px;
    line-height: 1.6;
    color: #444444;
    background: #fafaf5;
    padding: 12px;
    border-left: 3px solid #a89d74;
    border-radius: 0 4px 4px 0;
    margin-bottom: 15px;
}

.toun-sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.toun-sidebar-tag {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: #555555;
}

/* Booking Form */
.toun-booking-form {
    margin-top: 25px;
    background: #fafafa;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #eeeeee;
}

.toun-booking-form h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 15px;
    font-weight: 600;
}

.toun-form-group {
    margin-bottom: 12px;
}

.toun-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #666666;
}

.toun-form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #dce0e0;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.toun-form-group input:focus {
    border-color: #a89d74;
}

.toun-btn-submit {
    width: 100%;
    background: #088c98;
    color: #ffffff;
    border: none;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 10px;
}

.toun-btn-submit:hover {
    background: #189ba7;
}

.toun-btn-submit:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.toun-booking-timer {
    background: #fff9e6;
    border: 1px solid #f39c12;
    padding: 12px;
    border-radius: 6px;
    color: #d35400;
    font-weight: 600;
    text-align: center;
    font-size: 14px;
}

.toun-booking-error {
    color: #cc232a;
    font-size: 13px;
    margin-top: 8px;
    font-weight: 500;
}

.toun-booking-success {
    color: #27ae60;
    font-size: 13px;
    margin-top: 8px;
    font-weight: 600;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .toun-sidebar {
        width: 100%;
        right: -100%;
    }
    #toun-chess-container {
        padding: 15px;
    }
}
