/* Penalties Page Specific Styles */

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid rgba(255, 102, 0, 0.3);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.modal-close:hover {
    color: #ff6600;
}

/* Incident Drawer Styles */
.incident-drawer {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.incident-drawer:hover {
    border-color: rgba(255, 102, 0, 0.3);
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.2);
}

.incident-header {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
    user-select: none;
}

.incident-header:hover {
    background: rgba(255, 102, 0, 0.1);
}

.incident-header-left {
    flex: 1;
}

.incident-header-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.incident-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ff6600;
    margin-bottom: 5px;
    line-height: 1.4;
}

.incident-meta {
    font-size: 0.9rem;
    color: #999;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.incident-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.incident-drivers-preview {
    font-size: 0.9rem;
    color: #ccc;
    margin-top: 8px;
}

.incident-body {
    padding: 0 20px 20px 20px;
    display: none;
    animation: expandDown 0.3s ease;
}

@keyframes expandDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

.incident-body.open {
    display: block;
}

.incident-report-link {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
    border-radius: 5px;
}

.incident-report-link a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.incident-report-link a:hover {
    color: #60a5fa;
    text-decoration: underline;
}

.incident-driver-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid #ff6600;
    transition: all 0.3s ease;
}

.incident-driver-card:hover {
    background: rgba(0, 0, 0, 0.4);
    border-left-width: 5px;
}

.incident-driver-name {
    font-weight: 600;
    color: #ff8533;
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.incident-driver-penalties {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.penalty-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.penalty-points {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.penalty-warnings {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.incident-driver-reason {
    color: #ccc;
    font-size: 0.9rem;
    font-style: italic;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 5px;
}

.chevron {
    transition: transform 0.3s ease;
    font-size: 1.2rem;
    color: #ff6600;
    font-weight: bold;
}

.chevron.open {
    transform: rotate(180deg);
}

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

.incident-actions button {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Driver Form Row (in modal) */
.driver-form-row {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.driver-form-row:hover {
    border-color: rgba(255, 102, 0, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.driver-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.driver-form-header h4 {
    color: #ff8533;
    margin: 0;
}

.driver-form-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.driver-form-fields .form-group {
    margin-bottom: 0;
}

.driver-form-fields label {
    font-size: 0.9rem;
    margin-bottom: 5px;
    display: block;
}

.driver-form-fields input,
.driver-form-fields textarea {
    width: 100%;
}

.driver-form-fields textarea {
    min-height: 60px;
    resize: vertical;
    font-family: inherit;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.empty-state-subtext {
    font-size: 0.9rem;
    color: #666;
}

/* Penalty Points Table Specific */
.penalty-points-cell {
    font-weight: bold;
}

.penalty-points-high {
    color: #ef4444 !important;
}

.penalty-points-medium {
    color: #f59e0b !important;
}

.penalty-points-low {
    color: #22c55e !important;
}

.penalty-warnings-cell {
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 95vh;
    }

    .incident-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .incident-header-right {
        width: 100%;
        justify-content: flex-end;
    }

    .incident-meta {
        flex-direction: column;
        gap: 8px;
    }

    .incident-driver-penalties {
        flex-direction: column;
        gap: 10px;
    }

    .driver-form-fields {
        grid-template-columns: 1fr;
    }

    .incident-actions {
        flex-direction: column;
        width: 100%;
    }

    .incident-actions button {
        width: 100%;
    }
}

/* Loading State */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ff6600;
    animation: spin 1s ease-in-out infinite;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}
