/* Global Styles - Used across multiple pages */

/* Status Colors */
.status-healthy {
    color: #27AB83;
}

.status-warning {
    color: #F0B429;
}

.status-critical {
    color: #E12D39;
}

.hidden {
    display: none !important;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.status-badge.status-healthy {
    background: #D5F5E3;
    color: #27AB83;
}

.status-badge.status-warning {
    background: #FEF3C7;
    color: #D97706;
}

/* Activity Indicators */
.activity-icon {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.activity-recovery {
    background: #27AB83;
}

.activity-alert {
    background: #E12D39;
}

.activity-info {
    background: #3B82F6;
}

/* HTTP Status Codes */
.http-status {
    display: inline-block;
    background-color: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.http-status.error {
    background-color: #dc3545;
}

.http-status.warning {
    background-color: #ffc107;
    color: #333;
}

/* Status Icons */
.status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    color: white !important;
}

.status-icon.success {
    background-color: #28a745;
}

.status-icon.error {
    background-color: #dc3545;
}

.status-icon.warning {
    background-color: #ffc107;
    color: #333 !important;
}

.status-icon.info {
    background-color: #6c757d;
    color: #fff;
}

.status-icon.redirect {
    background-color: #007bff;
    color: #fff;
}

.status-icon.unknown {
    background-color: #6c757d;
    color: #fff;
}

.status-icon.expired {
    background: #f44336;
}

/* Common UI Elements */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: #007cba;
    color: white;
}

.btn-primary:hover {
    background: #005a87;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f1f3f4;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Details Toggle */
.show-details, .show-less {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    margin-top: 16px;
    display: inline-block;
    cursor: pointer;
}

.show-details:hover, .show-less:hover {
    text-decoration: underline;
}

/* Details Section */
.details-section {
    background: #fafbfc;
    padding: 24px;
    border-radius: 8px;
    margin-top: 20px;
}

.details-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e3e5e8;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
}

.details-table td {
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.details-label {
    font-weight: 500;
    color: #666;
    width: 160px;
}

.details-value {
    color: #333;
}

/* Status Container */
.status-container {
    background: #f0f9f0;
    border: 1px solid #d4edda;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    position: relative;
}

.status-container.error {
    background: #fdf2f2;
    border-color: #f8d7da;
}

.status-container.warning {
    background: #fffbf0;
    border-color: #ffeaa7;
}

.status-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.status-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin: 0;
}

.status-message {
    margin: 0;
    color: #666;
    line-height: 1.4;
}

/* Responsive Base Styles */
@media(max-width: 768px) {
    .status-badge {
        font-size: 12px;
        padding: 2px 6px;
    }

    .btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* History Page Styles */
.stats-container {
    margin-bottom: 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-card.success {
    background: #f0f9f0;
    border-color: #d4edda;
}

.stat-card.warning {
    background: #fffbf0;
    border-color: #ffeaa7;
}

.stat-card.error {
    background: #fdf2f2;
    border-color: #f8d7da;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filters-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 32px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: end;
}

.filter-group label {
    font-weight: 500;
    margin-bottom: 4px;
    display: block;
}

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

.filter-actions .btn {
    white-space: nowrap;
}

.history-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.history-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.result-count {
    color: #666;
    font-size: 14px;
}

.history-table-container {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th {
    background: #f8f9fa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e9ecef;
}

.history-table td {
    padding: 16px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.history-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.history-row:hover {
    background-color: #f8f9fa;
}

.type-info strong {
    display: block;
    color: #333;
}

.site-url {
    color: #666;
    font-size: 12px;
    margin-top: 2px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-succeeded {
    background: #d1ecf1;
    color: #0c5460;
    background: #d4edda;
    color: #155724;
}

.status-badge.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.status-warning {
    background: #fff3cd;
    color: #856404;
}

.timestamp {
    color: #333;
    font-weight: 500;
}

.time {
    color: #666;
    font-size: 12px;
    margin-top: 2px;
}

.details-toggle {
    background: none;
    border: 1px solid #0073aa;
    color: #0073aa;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.details-toggle:hover {
    background: #0073aa;
    color: white;
}

.toggle-icon {
    font-size: 10px;
}

.details-row {
    background: #f8f9fa;
}

.details-content {
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin: 10px 0;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item strong {
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.http-status-code {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.http-status-code.success {
    background: #d4edda;
    color: #155724;
}

.http-status-code.error {
    background: #f8d7da;
    color: #721c24;
}

.success {
    color: #155724;
}

.error {
    color: #721c24;
}

.text-gray {
    color: #666;
}

.detail-message,
.detail-error,
.detail-warning {
    margin-top: 16px;
    padding: 12px;
    border-radius: 4px;
}

.detail-message {
    background: #e7f3ff;
    border: 1px solid #b6d7ff;
}

.detail-error {
    background: #fdf2f2;
    border: 1px solid #f8d7da;
}

.detail-warning {
    background: #fffbf0;
    border: 1px solid #ffeaa7;
}

.error-text {
    color: #721c24;
    margin: 4px 0 0 0;
}

.warning-text {
    color: #856404;
    margin: 4px 0 0 0;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.no-results h3 {
    color: #333;
    margin-bottom: 8px;
}

.no-results p {
    margin: 0;
}

.status-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin: 0;
}

.status-message {
    margin: 0;
    color: #666;
    line-height: 1.4;
}

.details-section {
    background: #fafbfc;
    padding: 24px;
    border-radius: 8px;
    margin-top: 20px;
}

.details-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 10px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e3e5e8;
    color: #333;
    margin-bottom: 16px;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
}

.details-table td {
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.details-label {
    font-weight: 500;
    color: #666;
    width: 160px;
}

.details-value {
    color: #333;
}

.http-status {
    display: inline-block;
    background-color: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.http-status.error {
    background-color: #dc3545;
}

.http-status.warning {
    background-color: #ffc107;
    color: #333;
}
