/* 
 * PageAlert - Custom CSS styles
 * This file contains custom styles that extend the Bootstrap theme
 */

/* General styles */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

footer {
    margin-top: auto;
}

/* Card styling enhancements */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header:first-child {
    border-radius: calc(0.5rem - 1px) calc(0.5rem - 1px) 0 0;
}

/* Calendar styling */
.calendar-table th {
    background-color: rgba(0, 0, 0, 0.03);
    text-align: center;
    padding: 0.5rem;
}

.calendar-table td {
    height: 60px;
    vertical-align: middle;
    transition: background-color 0.15s ease-in-out;
}

/* Alert severity color indicators */
.alert-item.critical {
    border-left: 4px solid var(--bs-danger);
}

.alert-item.high {
    border-left: 4px solid var(--bs-warning);
}

.alert-item.medium {
    border-left: 4px solid var(--bs-info);
}

.alert-item.low {
    border-left: 4px solid var(--bs-success);
}

.alert-item.info {
    border-left: 4px solid var(--bs-secondary);
}

/* Alert details enhancements */
.alert-details {
    cursor: pointer;
    text-decoration: none;
    color: var(--bs-body-color);
    transition: color 0.15s ease-in-out;
}

.alert-details:hover {
    color: var(--bs-primary);
    text-decoration: underline;
}

/* Avatar placeholder styling */
.avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    user-select: none;
}

/* Quick action buttons on dashboard */
.btn-dashboard-action {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.btn-dashboard-action i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* On-call status indicators */
.on-call-active {
    position: relative;
}

.on-call-active::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: var(--bs-success);
    border-radius: 50%;
    bottom: 0;
    right: 0;
    border: 2px solid var(--bs-body-bg);
}

/* Timeline styling for alert details */
#alertTimeline .list-group-item {
    border-left: 2px solid var(--bs-primary);
    padding-left: 1.5rem;
    position: relative;
}

#alertTimeline .list-group-item::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: var(--bs-primary);
    border-radius: 50%;
    left: -7px;
    top: 50%;
    transform: translateY(-50%);
}

#alertTimeline #acknowledgedTimelineItem {
    border-left-color: var(--bs-warning);
}

#alertTimeline #acknowledgedTimelineItem::before {
    background-color: var(--bs-warning);
}

#alertTimeline #resolvedTimelineItem {
    border-left-color: var(--bs-success);
}

#alertTimeline #resolvedTimelineItem::before {
    background-color: var(--bs-success);
}

/* Code blocks for API examples */
.bg-dark code {
    display: block;
    white-space: pre-wrap;
    color: var(--bs-light);
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    .calendar-table {
        font-size: 0.8rem;
    }
    
    .calendar-table th small {
        display: none;
    }
}

/* Code block with copy button */
.code-block {
    position: relative;
    padding-right: 10px;
}

.copy-button-container {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.copy-button {
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out;
}

.copy-button:hover {
    opacity: 1;
}

/* Alert firing styles */
tr.alert-firing {
    background-color: rgba(var(--bs-danger-rgb), 0.15) !important;
    animation: pulsate 2s infinite;
}

tr.alert-firing td {
    border-color: rgba(var(--bs-danger-rgb), 0.5);
}

.fa-shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) infinite;
    transform: translate3d(0, 0, 0);
}

@keyframes pulsate {
    0% { background-color: rgba(var(--bs-danger-rgb), 0.15); }
    50% { background-color: rgba(var(--bs-danger-rgb), 0.25); }
    100% { background-color: rgba(var(--bs-danger-rgb), 0.15); }
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(1px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-2px, 0, 0); }
    40%, 60% { transform: translate3d(2px, 0, 0); }
}
