/* Frontend Styles cho BCA Google Sheets to Gravity Forms */
.bca-gsheets-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.bca-gs-error {
    color: #b91c1c;
    background: #fef2f2;
    padding: 15px 20px;
    border-radius: 6px;
    border: 1px solid #fecaca;
    font-weight: 500;
}

.bca-gs-table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #f3f4f6;
}

.bca-gs-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    overflow: hidden;
}

.bca-gs-table thead th {
    background: #f9fafb;
    color: #374151;
    font-weight: 600;
    text-align: left;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    white-space: nowrap;
}

.bca-gs-table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
    vertical-align: middle;
    font-size: 14px;
}

.bca-gs-table tbody tr:last-child td {
    border-bottom: none;
}

.bca-gs-table tbody tr:hover {
    background: #f9fafb;
}

.bca-gs-row-clickable {
    cursor: pointer;
}

/* Actions */
.bca-gs-action-col {
    text-align: right;
    white-space: nowrap;
}

.bca-gs-contact-btn, .bca-gs-detail-btn, .bca-gs-contact-btn-drawer {
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 13px;
    margin-left: 8px;
}

.bca-gs-contact-btn, .bca-gs-contact-btn-drawer {
    background: #9d7d4f; /* Màu vàng nâu theo yêu cầu */
}
.bca-gs-contact-btn:hover, .bca-gs-contact-btn-drawer:hover {
    background: #8b6c43; /* Màu hover đậm hơn một chút */
}

.bca-gs-detail-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}
.bca-gs-detail-btn:hover {
    background: #e5e7eb;
}

/* Modal CSS Foundation */
.bca-gs-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.bca-gs-modal-content {
    background: #fff;
    padding: 30px 20px 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

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

.bca-gs-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
}
.bca-gs-modal-close:hover {
    color: #111827;
}

/* Drawer CSS (Ngăn kéo chi tiết) */
.bca-gs-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bca-gs-drawer-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.bca-gs-drawer-content {
    position: absolute;
    top: 0;
    right: -700px;
    width: 100%;
    max-width: 700px;
    height: 100%;
    background: #fff;
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.bca-gs-drawer-overlay.is-active .bca-gs-drawer-content {
    right: 0;
}

.bca-gs-drawer-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.bca-gs-drawer-header h3 {
    margin: 0;
    font-size: 18px;
    color: #111827;
    font-weight: 600;
}

.bca-gs-drawer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
    padding: 0;
}
.bca-gs-drawer-close:hover {
    color: #111827;
}

.bca-gs-drawer-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    background: #f9fafb; /* Màu nền xám nhạt để nổi bật các khối trắng */
}

.bca-gs-detail-item {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.bca-gs-detail-item strong {
    display: flex;
    align-items: center;
    color: #004629; /* Màu xanh lá đậm theo yêu cầu */
    font-size: 13px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.bca-gs-detail-item strong::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 14px;
    background: #004629;
    margin-right: 8px;
    border-radius: 2px;
}

.bca-gs-detail-item div {
    color: #374151;
    font-size: 15px;
    line-height: 1.7;
}

.bca-gs-empty-val {
    color: #9ca3af;
    font-style: italic;
    font-size: 14px;
}

.bca-gs-drawer-footer {
    padding: 16px 24px;
    border-top: 1px solid #f3f4f6;
    text-align: right;
    background: #f9fafb;
}

/* Responsive Table */
@media screen and (max-width: 768px) {
    .bca-gs-table-responsive {
        border: none;
        box-shadow: none;
        background: transparent;
        overflow-x: hidden;
    }
    
    .bca-gs-table, 
    .bca-gs-table thead, 
    .bca-gs-table tbody, 
    .bca-gs-table th, 
    .bca-gs-table td, 
    .bca-gs-table tr {
        display: block;
        width: 100%;
    }

    .bca-gs-table thead tr {
        display: none;
    }

    .bca-gs-table tr {
        margin-bottom: 15px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        background: #fff;
    }

    .bca-gs-table td {
        border: none;
        border-bottom: 1px solid #f3f4f6;
        padding: 12px 15px;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        min-height: 48px;
        gap: 15px;
    }
    
    .bca-gs-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #374151;
        text-align: left;
        flex-shrink: 0;
        width: 40%;
        word-break: break-word;
    }

    .bca-gs-table td .bca-gs-value {
        flex-grow: 1;
        text-align: right;
        word-break: break-word;
    }
    
    .bca-gs-table td:last-child {
        border-bottom: 0;
        justify-content: space-between;
        padding: 12px 15px;
        gap: 10px;
    }
    
    .bca-gs-action-col::before {
        display: none !important;
    }
    
    .bca-gs-contact-btn, .bca-gs-detail-btn {
        flex: 1;
        text-align: center;
        margin: 0;
        padding: 10px;
    }
    
    .bca-gs-drawer-content {
        max-width: 100%;
    }
    
    .bca-gs-drawer-footer {
        text-align: left;
    }
    
    .bca-gs-contact-btn-drawer {
        margin: 0;
    }
}
