/* ============================================
   WORK ORDERS PAGE SPECIFIC STYLES
   ============================================ */

/* Stats Container */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 5px solid;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    z-index: 0;
}

.stat-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.stat-card i {
    font-size: 2.5em;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.stat-card h3 {
    font-size: 2.2em;
    margin-bottom: 8px;
    color: var(--primary);
    position: relative;
    z-index: 1;
    font-weight: 700;
}

.stat-card p {
    color: var(--gray);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.stat-pending {
    border-top-color: var(--warning);
}

.stat-pending i {
    color: var(--warning);
}

.stat-progress {
    border-top-color: var(--info);
}

.stat-progress i {
    color: var(--info);
}

.stat-completed {
    border-top-color: var(--success);
}

.stat-completed i {
    color: var(--success);
}

.stat-total {
    border-top-color: var(--danger);
}

.stat-total i {
    color: var(--danger);
}

/* Filter Section */
.filter-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.filter-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.filter-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

/* Table Actions */
.table-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.search-box input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.2);
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--earth-brown);
    transition: all 0.3s ease;
}

.search-box input:focus + i {
    color: var(--secondary);
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

/* Work Order Details */
.work-order-details {
    margin-bottom: 25px;
}

.detail-row {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.detail-label {
    font-weight: 700;
    width: 180px;
    color: var(--primary);
    font-size: 0.95rem;
}

.detail-value {
    flex: 1;
    color: var(--dark);
    font-size: 0.95rem;
}

.description-box {
    background: rgba(74, 124, 89, 0.05);
    padding: 20px;
    border-radius: 10px;
    margin-top: 10px;
    border-left: 5px solid var(--secondary);
    line-height: 1.6;
}

.work-order-history {
    margin-top: 25px;
}

.work-order-history h4 {
    margin-bottom: 15px;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.history-item {
    padding: 15px;
    border-left: 4px solid var(--secondary);
    background: rgba(74, 124, 89, 0.05);
    margin-bottom: 10px;
    border-radius: 0 10px 10px 0;
    transition: all 0.3s ease;
}

.history-item:hover {
    transform: translateX(5px);
    background: rgba(74, 124, 89, 0.08);
}

.history-date {
    font-size: 0.85em;
    color: var(--gray);
    margin-top: 5px;
    font-weight: 500;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--secondary);
    color: var(--secondary);
    font-weight: 600;
}

.btn-outline:hover {
    background: var(--secondary);
    color: white;
    transform: translateY(-3px);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.2);
}

/* Empty state for tables */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--gray);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: rgba(0, 0, 0, 0.1);
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--dark);
    font-size: 1.3rem;
}

.empty-state p {
    max-width: 400px;
    margin: 0 auto;
    font-size: 0.95rem;
}

/* Dropdown styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: white;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 5px;
    right: 0;
}

.dropdown-content a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
    transition: background 0.3s;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background: #f5f5f5;
}

.dropdown-content a i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

#exportDropdownBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Modal Styling Improvements */
.modal-content {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
    max-height: 90vh;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #4a7c59 0%, #3a6548 100%);
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-header .close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-header .close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #eaeaea;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f9f9f9;
    border-radius: 0 0 12px 12px;
}

/* Print Options Modal Specific Styling */
#printOptionsModal .modal-content {
    max-width: 500px;
    width: 90%;
    align-content: center;
    justify-content: center;
}

#printOptionsModal .modal-body {
    padding: 25px;
    align-content: center;
    justify-content: center;
}

.print-option-group {
    margin-bottom: 25px;
}

.print-option-group label {
    display: block;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
}

.print-options {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eaeaea;
}

.radio-option {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 2px solid #eaeaea;
    transition: all 0.3s ease;
    cursor: pointer;
}

.radio-option:last-child {
    margin-bottom: 0;
}

.radio-option:hover {
    border-color: #4a7c59;
    background: #f8f9f9;
}

.radio-option input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: #4a7c59;
}

.radio-option span {
    font-size: 0.95rem;
    color: #444;
    font-weight: 500;
}

.radio-option.selected {
    border-color: #4a7c59;
    background: rgba(74, 124, 89, 0.05);
}

.columns-selection {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eaeaea;
}

.columns-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.column-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    border: 2px solid #eaeaea;
    transition: all 0.3s ease;
    cursor: pointer;
}

.column-option:hover {
    border-color: #4a7c59;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.column-option input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #4a7c59;
}

.column-option span {
    font-size: 0.9rem;
    color: #444;
    font-weight: 500;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Completed Work Orders Section */
.completed-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.completed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1) 0%, rgba(39, 174, 96, 0.05) 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

.completed-header:hover {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15) 0%, rgba(39, 174, 96, 0.1) 100%);
}

.completed-header h3 {
    color: var(--primary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-weight: 600;
}

.completed-header h3 i {
    color: var(--success);
    font-size: 1.4rem;
}

.completed-container {
    display: none;
    animation: slideDown 0.3s ease-out;
}

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

.completed-container table {
    margin: 0;
    border-radius: 0;
    border: none;
    border-top: 1px solid rgba(46, 204, 113, 0.1);
}

.completed-container table th {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15) 0%, rgba(39, 174, 96, 0.1) 100%);
    color: var(--success);
    font-weight: 700;
}

.completed-container table tr:hover {
    background-color: rgba(46, 204, 113, 0.05);
}

/* Badge for completed count */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    display: inline-block;
    margin-left: 8px;
}

#completedCountBadge {
    background: linear-gradient(135deg, var(--success) 0%, #219653 100%);
    color: white;
    padding: 5px 15px;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

/* Status khusus untuk completed section */
.completed-container .status-completed {
    background: linear-gradient(135deg, #55efc4 0%, #00b894 100%);
    color: #006442;
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 50px;
    font-size: 0.9em;
    min-width: 120px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

/* Main Logo */
.main-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    background: none;
    padding: 5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .table-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .actions {
        justify-content: center;
    }
    
    .detail-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .detail-label {
        width: 100%;
    }
    
    .dropdown {
        width: 100%;
    }
    
    #exportDropdownBtn {
        width: 100%;
    }
    
    .dropdown-content {
        width: 100%;
        right: 0;
    }
    
    .columns-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .modal-footer .btn:last-child {
        margin-bottom: 0;
    }
    
    .completed-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .completed-header .btn {
        align-self: stretch;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-actions .btn {
        width: 100%;
    }
    
    .actions {
        justify-content: space-between;
    }
    
    .btn-icon {
        width: 40px;
        height: 40px;
    }
    
    .completed-header h3 {
        font-size: 1.1rem;
    }
}

/* Print Options Hover Effects */
.radio-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(74, 124, 89, 0.1);
}

.column-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(74, 124, 89, 0.1);
}

/* Button styles untuk toggle completed */
#toggleCompletedBtn {
    background: transparent;
    border: 2px solid var(--success);
    color: var(--success);
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#toggleCompletedBtn:hover {
    background: var(--success);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.4);
}

#toggleCompletedBtn.active {
    background: var(--success);
    color: white;
}

#toggleCompletedBtn i {
    transition: transform 0.3s ease;
}

#toggleCompletedBtn.active i {
    transform: rotate(180deg);
}

/* Table styling khusus untuk completed */
.completed-container table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.completed-container th, 
.completed-container td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.completed-container th {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15) 0%, rgba(39, 174, 96, 0.1) 100%);
    font-weight: 700;
    color: var(--success);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.completed-container tr {
    transition: all 0.3s ease;
}

.completed-container tr:hover {
    background-color: rgba(46, 204, 113, 0.05);
    transform: translateX(5px);
}