/* Modern History Grid Layout */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    padding: 20px;
}

.history-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.history-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.history-card-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e9ecef;
    gap: 12px;
}

.history-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.history-icon-primary {
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: white;
}

.history-icon-info {
    background: linear-gradient(135deg, #0dcaf0, #20c997);
    color: white;
}

.history-icon-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #212529;
}

.history-icon-success {
    background: linear-gradient(135deg, #198754, #20c997);
    color: white;
}

.history-icon-secondary {
    background: linear-gradient(135deg, #6c757d, #adb5bd);
    color: white;
}

.history-meta {
    flex: 1;
    min-width: 0;
}

.history-title {
    font-weight: 600;
    font-size: 16px;
    color: #212529;
    margin-bottom: 4px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-time {
    font-size: 13px;
    color: #6c757d;
    display: flex;
    align-items: center;
}

.history-badge {
    flex-shrink: 0;
}

.history-card-body {
    padding: 20px;
}

.history-description {
    font-size: 14px;
    color: #495057;
    margin-bottom: 15px;
    line-height: 1.5;
}

.history-change-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    border-left: 4px solid #0d6efd;
}

.change-field {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.change-values {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.old-value, .new-value {
    display: flex;
    align-items: center;
    font-size: 13px;
}

.old-value .label, .new-value .label {
    min-width: 60px;
    font-weight: 500;
    color: #6c757d;
}

.old-value .value {
    color: #dc3545;
    font-weight: 500;
}

.new-value .value {
    color: #198754;
    font-weight: 500;
}

.history-content {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
}

.content-preview {
    font-size: 13px;
    color: #495057;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-card-footer {
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.history-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    flex: 1;
}

.info-item {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
}

.info-item i {
    color: #adb5bd;
}

.history-actions {
    flex-shrink: 0;
}

/* List View Styles */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.history-list-item {
    border-bottom: 1px solid #e9ecef;
    padding: 16px 20px;
    transition: background-color 0.2s ease;
}

.history-list-item:hover {
    background-color: #f8f9fa;
}

.history-list-item:last-child {
    border-bottom: none;
}

.history-list-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-right: 12px;
    flex-shrink: 0;
}

.history-list-meta {
    min-width: 0;
}

.history-list-title {
    font-weight: 600;
    font-size: 15px;
    color: #212529;
}

.history-list-time {
    font-size: 13px;
    color: #6c757d;
    white-space: nowrap;
}

.history-list-description {
    font-size: 14px;
    color: #495057;
    line-height: 1.4;
}

.history-list-change {
    font-size: 13px;
    padding: 6px 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #0d6efd;
}

.history-list-content {
    font-size: 13px;
    padding: 6px 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.history-list-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #f1f3f4;
}

.history-list-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #6c757d;
}

.history-list-info i {
    color: #adb5bd;
}

.history-list-actions {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .history-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .history-card-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .history-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .history-title {
        font-size: 15px;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
    
    .history-card-body {
        padding: 16px;
    }
    
    .history-card-footer {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .history-info {
        gap: 10px;
    }
    
    .info-item {
        font-size: 11px;
    }
    
    .history-actions {
        width: 100%;
    }
    
    .history-actions .btn {
        width: 100%;
    }

    /* List View Mobile */
    .history-list-item {
        padding: 12px 16px;
    }

    .history-list-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
        margin-right: 10px;
    }

    .history-list-title {
        font-size: 14px;
    }

    .history-list-time {
        font-size: 12px;
    }

    .history-list-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .history-list-info {
        flex-direction: column;
        gap: 4px;
    }

    .history-list-actions {
        width: 100%;
    }

    .history-list-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .history-grid {
        padding: 10px;
        gap: 10px;
    }
    
    .history-card-header {
        padding: 10px 12px;
    }
    
    .history-card-body {
        padding: 12px;
    }
    
    .history-card-footer {
        padding: 10px 12px;
    }
    
    .history-info {
        flex-direction: column;
        gap: 6px;
    }
}