/**
 * Onfleet My Account Styles
 * 
 * Styles for Onfleet task display in WooCommerce My Account pages
 * 
 * @package Onfleet_WooCommerce_Status_Sync
 * @author Prabhakar Kumar Shaw
 */

/* Onfleet Tasks Section */
.onfleet-tasks-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.onfleet-tasks-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.4em;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Summary Stats */
.onfleet-tasks-summary {
    margin-bottom: 20px;
}

.summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 120px;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #0073aa;
}

/* Tasks List */
.onfleet-tasks-list h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2em;
}

.task-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.task-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.task-info {
    flex: 1;
}

.task-title {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #333;
}

.task-id {
    font-size: 0.9em;
    color: #666;
    font-weight: normal;
}

.task-status {
    margin-bottom: 8px;
}

.status-label {
    font-size: 0.9em;
    color: #666;
    margin-right: 8px;
}

.status-value {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
    text-transform: uppercase;
}

/* Status Colors */
.status-task_started { background: #fff3cd; color: #856404; }
.status-task_assigned { background: #d1ecf1; color: #0c5460; }
.status-task_arrival { background: #d4edda; color: #155724; }
.status-task_completed { background: #d1ecf1; color: #0c5460; }
.status-task_failed { background: #f8d7da; color: #721c24; }
.status-task_created { background: #e2e3e5; color: #383d41; }
.status-task_updated { background: #fff3cd; color: #856404; }
.status-task_deleted { background: #f8d7da; color: #721c24; }
.status-task_unassigned { background: #f8d7da; color: #721c24; }
.status-task_delayed { background: #fff3cd; color: #856404; }

.task-meta {
    font-size: 0.9em;
    color: #666;
}

.last-update {
    display: block;
}

.task-actions {
    margin-left: 20px;
    margin-bottom: 20px;
}

.view-task-details {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.view-task-details:hover {
    background: #005a87;
}

/* Modal Styles */
.onfleet-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3em;
}

.modal-close {
    font-size: 24px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 0;
    max-height: 70vh;
    overflow-y: auto;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Task Details Content */
.task-details-content {
    padding: 20px;
}

.task-details-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.task-details-title {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.2em;
}

.task-details-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 0.9em;
    color: #666;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-weight: bold;
    margin-bottom: 2px;
}

.meta-value {
    color: #333;
}

/* Events Timeline */
.events-timeline {
    margin-top: 20px;
}

.events-timeline h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
}

.event-item {
    display: flex;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.event-icon {
    width: 40px;
    height: 40px;
    background: #0073aa;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 0.9em;
    font-weight: bold;
    flex-shrink: 0;
}

.event-content {
    flex: 1;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.event-status {
    font-weight: bold;
    color: #333;
}

.event-time {
    font-size: 0.9em;
    color: #666;
}

.event-comments {
    color: #555;
    margin-bottom: 8px;
}

.event-meta {
    font-size: 0.8em;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .summary-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .stat-item {
        flex-direction: row;
        justify-content: space-between;
        min-width: auto;
    }
    
    .task-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .task-actions {
        margin-left: 0;
        width: 100%;
    }
    
    .view-task-details {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .task-details-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .event-item {
        flex-direction: column;
        text-align: center;
    }
    
    .event-icon {
        margin: 0 auto 10px;
    }
    
    .event-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Print Styles */
@media print {
    .onfleet-modal {
        position: static;
        background: none;
    }
    
    .modal-content {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .modal-close {
        display: none;
    }
}

.pet-popup-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 10000;
}
.pet-popup {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    animation: popupFade 0.3s ease-in-out;
}
.pet-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}
@keyframes popupFade {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}
