@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css");

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f9fafb;
    color: #111827;
    line-height: 1.5;
}

html, body {
    height: 100%;
    /* overflow: hidden; */
    background-color: #111827;
}

.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-wrapper {
    background-color: #e4e4e4;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Dashboard container */
.dashboard-container {
    display: flex;
    flex-direction: column;
    height: 100%; /* Changed from 100vh to 100% */
    background-color: #111827;
    color: #fff;
}

/* Header */
.header {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
}

.header-left p {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Progress stats */
.progress-stats {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.progress-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.progress-svg {
    width: 6rem;
    height: 6rem;
    transform: rotate(-90deg);
}

.progress-bg {
    stroke: #e5e7eb;
}

.progress-fill {
    transition: stroke-dashoffset 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-percentage {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.progress-circle span:last-child {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
}

/* Main content */
.main-content {
    display: flex;
    flex-direction: row;
    flex: 1;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* Left panel */
.left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e5e7eb;
    background-color: #ffffff;
    min-width: 0;
    overflow: hidden;
}


/* Document header */
.document-header {
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem;
}

.header-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.bl-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bl-dropdown {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: #ffffff;
    color: #111827;
    font-size: 0.875rem;
    min-width: 150px;
}

.bl-dropdown:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Status badge */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid;
}

.status-pending {
    background-color: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

.status-completed {
    background-color: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}

.status-rejected {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

/* Navigation arrows */
.navigation-arrows {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover:not(:disabled) {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-counter {
    font-size: 0.875rem;
    color: #6b7280;
    min-width: 60px;
    text-align: center;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    height: 3rem;
}

.approve-btn {
    background-color: #059669;
    color: #ffffff;
}

.approve-btn:hover:not(:disabled) {
    background-color: #047857;
}

.reject-btn {
    background-color: #dc2626;
    color: #ffffff;
}

.reject-btn:hover:not(:disabled) {
    background-color: #b91c1c;
}

.reset-btn {
    background-color: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.reset-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.action-btn:disabled {
    background-color: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

.keyboard-hint {
    text-align: center;
    margin-top: 0.5rem;
}

.keyboard-hint p {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Document image container */
.document-image-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
}

.image-container {
    position: relative;
    height: 100%;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    overflow: auto;
    cursor: pointer;
    border: 2px dashed #d1d5db;
    transition: border-color 0.2s;
}

.image-container:hover {
    border-color: #3b82f6;
}

.document-image {
    width: auto;
    height: auto;
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

.image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Image overlay */
.image-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container:hover .image-overlay {
    background-color: rgba(0, 0, 0, 0.2);
}

.overlay-content {
    background-color: #ffffff;
    border-radius: 0.5rem;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.image-container:hover .overlay-content {
    opacity: 1;
}

.overlay-content span {
    font-weight: 500;
    color: #374151;
}

.overlay-content p {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Right panel */
.right-panel {
    width: 400px;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex-shrink: 0;
}

.milestone-header {
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem;
}

.milestone-header h3 {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.milestone-header p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.milestone-hint {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Milestone table */
.milestone-table-container {
    flex: 1;
    overflow-y: auto;
}

.milestone-table {
    width: 100%;
    border-collapse: collapse;
}

.milestone-table th {
    background-color: #f9fafb;
    padding: 0.75rem;
    text-align: left;
    font-weight: 500;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
}

.milestone-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.milestone-row:hover {
    background-color: #f9fafb;
}

.milestone-row.flagged {
    background-color: #fef2f2;
}

.milestone-code {
    font-weight: 500;
    width: 4rem;
    color:black;
}

.milestone-date {
    font-size: 0.875rem;
}

.date-display {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: #6b7280;
}

.date-value {
    display: block;
}

.original-date {
    font-size: 0.75rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.milestone-actions {
    width: 4rem;
}

.action-icon {
    padding: 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 0.25rem;
    color: #9ca3af;
    transition: all 0.2s;
    margin-right: 0.25rem;
}

.action-icon:hover {
    background-color: #f3f4f6;
}

.flag-btn.flagged {
    color: #dc2626;
    background-color: #fef2f2;
}

.edit-btn {
    color: #3b82f6;
}

.edit-btn:hover {
    color: #1d4ed8;
}

.edit-btn.highlight {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Edit container */
.edit-container {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.edit-input {
    flex: 1;
    padding: 0.25rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.edit-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.save-btn {
    color: #059669;
}

.cancel-btn {
    color: #dc2626;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: stretch;
    justify-content: stretch;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-weight: 600;
    color: #111827;
}

.close-btn {
    padding: 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    color: #6b7280;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.close-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin-bottom: 1rem;
    cursor: grab;
    user-select: none;
}

.modal-milestones {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Loading overlay */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.loader {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.loader-bar {
    width: 0.5rem;
    height: 2rem;
    background-color: #9ca3af;
    border-radius: 0.25rem;
    animation: scale-up 1.2s ease-in-out infinite;
}

.loader-bar:nth-child(2) {
    height: 3rem;
}

@keyframes scale-up {
    0%, 100% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(1.5);
    }
}

/* Tooltip */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #111827;
    color: #ffffff;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Responsive design */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .right-panel {
        width: 100%;
        height: 300px;
    }
    
    .progress-stats {
        gap: 1rem;
    }
    
    .progress-circle {
        transform: scale(0.8);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .header-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

.dropdown-toggle::after{
    color: white;
}

.dropdown-item:focus, .dropdown-item:hover {
    color: #2e3c54 !important;
    background-color: #d6d3d1 !important;
}
 
.image-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
}

.document-image {
    height: auto;
    max-width: 100%;
    width: auto;
}

.text-sm {
    font-size: 0.8em;
}