/* Base styles */
body {
    font-family: 'Montserrat', sans-serif;
}

/* File upload drag and drop styles */
.drag-active {
    border-color: #f2e782ff;
    background-color: rgba(242, 231, 130, 0.1);
}

/* File list item styles */
.file-item:hover {
    background-color: rgba(242, 231, 130, 0.1);
}

.file-item.selected {
    background-color: rgba(242, 231, 130, 0.2);
    border-left: 4px solid #f2e782ff;
}

/* PDF viewer styles */
#pdfViewer {
    min-height: 500px;
}

/* Result table styles */
.result-table td, .result-table th {
    padding: 6px 8px;
    text-align: left;
    border: 1px solid #898d8e;
    word-break: break-word;
    font-size: 12px;
}

.result-table th {
    background-color: #3a3b3c;
    color: #f2e782ff;
    font-size: 13px;
    font-weight: 600;
}

.result-table tr:hover {
    background-color: rgba(242, 231, 130, 0.1);
    cursor: pointer;
}

/* Responsive table styles */
@media (min-width: 640px) {
    .result-table td, .result-table th {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .result-table th {
        font-size: 15px;
    }
}

/* Ensure tables don't overflow in small screens */
.result-table {
    table-layout: fixed;
    width: 100%;
}

.result-table td:first-child {
    width: 30%;
}

.result-table td:last-child {
    width: 70%;
}

/* Golden gradient button */
.golden-gradient {
    background: linear-gradient(135deg, #f2e782ff 0%, #d4c85a 100%);
}

/* Editable cell styles */
.editable-cell {
    position: relative;
}

.edit-input {
    width: 100%;
    background-color: #3a3b3c;
    color: #cfcbbf;
    border: 2px solid #f2e782ff;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    font-family: inherit;
}

.edit-input:focus {
    outline: none;
    border-color: #d4c85a;
}

/* Edited indicator styles */
.edited-indicator {
    color: #f2e782ff;
    font-style: italic;
}

.edited-indicator::before {
    content: "✏ ";
}

/* Login Modal Animations */
@keyframes modal-fade-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-modal-fade-in {
    animation: modal-fade-in 0.3s ease-out;
}

/* Modal backdrop blur effect */
#loginModal.show, #confirmModal.show {
    backdrop-filter: blur(4px);
}

/* Login form focus styles */
#loginForm input:focus {
    box-shadow: 0 0 0 3px rgba(242, 231, 130, 0.3);
}

/* Mobile-specific modal optimizations */
@media (max-width: 640px) {
    #confirmModal {
        align-items: flex-start;
        padding-top: 10px;
    }
    
    #confirmModal .animate-modal-fade-in {
        border-radius: 8px;
        min-height: calc(100vh - 20px);
    }
    
    .result-table {
        font-size: 11px;
    }
    
    .result-table td, .result-table th {
        padding: 4px 6px;
    }
    
    /* Make buttons more touch-friendly on mobile */
    #cancelConfirm, #confirmSend {
        min-height: 44px;
    }
}

/* Ensure proper scrolling on iOS */
@supports (-webkit-overflow-scrolling: touch) {
    #confirmResultsContainer {
        -webkit-overflow-scrolling: touch;
    }
}

/* Strong yellow border for empty fields */
.border-yellow-strong {
    border: 4px solid #fbbf24 !important;
    border-radius: 4px;
}

/* Locked BEA item styles */
.bea-item.locked {
    background-color: #f3f4f6 !important;
    border-color: #9ca3af !important;
    opacity: 0.6;
    cursor: not-allowed !important;
}

.bea-item.locked:hover {
    background-color: #f3f4f6 !important;
}

.bea-item.locked .text-primary {
    color: #6b7280 !important;
}

/* Enhanced tooltip styles for locked BEA items */
.bea-item[title] {
    position: relative;
}
/* Show tooltip below for first item to avoid clipping */
.bea-item[title]:first-child:hover::after {
    content: attr(title);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    margin-top: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 300px;
    text-align: center;
}

.bea-item[title]:first-child:hover::before {
    content: "";
    position: absolute;
    top: 100%;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: #1f2937;
    z-index: 1000;
    pointer-events: none;
}

/* Show tooltip above for other items */
.bea-item[title]:not(:first-child):hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    margin-bottom: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 300px;
    text-align: center;
}

.bea-item[title]:not(:first-child):hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
    z-index: 1000;
    pointer-events: none;
}

#alertModal .modal-box {
    background-color: #3a3b3c;
    color: #f2e782ff;
    border-radius: 12px;
    padding: 1.5rem;
}