/* CaYaDev Status Admin Panel Styles */

/* Admin Sections */
.admin-section {
    max-width: 800px;
    margin: 0 auto;
}

.admin-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.login-card {
    max-width: 400px;
    margin: 3rem auto;
}

.admin-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.admin-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--background-light);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--background-medium);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-success {
    background: var(--status-operational);
    color: white;
}

.btn-warning {
    background: var(--status-degraded);
    color: #000;
}

.btn-danger {
    background: var(--status-major);
    color: white;
}

/* Error Message */
.error-message {
    color: var(--status-major);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.success-message {
    color: var(--status-operational);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

/* Admin Services List */
.admin-services-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--background-dark);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.admin-service-item.is-reorder-mode {
    cursor: move;
}

.admin-service-item.drag-over {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.admin-service-item.dragging {
    opacity: 0.65;
}

.admin-service-item.is-invalid-id {
    border-color: rgba(239, 68, 68, 0.45);
}

.drag-handle {
    border: 1px solid var(--border-color);
    background: var(--background-medium);
    color: var(--text-muted);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: grab;
    margin-right: 0.75rem;
    font-size: 0.95rem;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-handle:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.section-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.admin-service-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-service-name {
    font-weight: 500;
    color: var(--text-primary);
}

.admin-service-status {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.admin-service-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-select {
    padding: 0.5rem 1rem;
    background: var(--background-medium);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

.status-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Checkbox toggle */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Active Incidents Admin */
.admin-incident-item {
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.admin-incident-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.admin-incident-title {
    font-weight: 500;
    color: var(--text-primary);
}

.admin-incident-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.admin-incident-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.admin-incident-update {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.admin-incident-update input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--background-medium);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.no-items {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Admin Actions */
.admin-actions {
    text-align: center;
    margin-top: 2rem;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: var(--status-operational);
}

.toast.error {
    background: var(--status-major);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Dashboard Statistics */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-box {
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}

.stat-box.status-operational {
    border-left: 4px solid var(--status-operational);
}

.stat-box.status-degraded {
    border-left: 4px solid var(--status-degraded);
}

.stat-box.status-partial {
    border-left: 4px solid var(--status-partial);
}

.stat-box.status-major {
    border-left: 4px solid var(--status-major);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content form {
    padding: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.form-actions .btn {
    margin: 0;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

/* Settings */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--background-dark);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.setting-item > div {
    flex: 1;
}

.setting-item h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.setting-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.setting-select,
.setting-input {
    padding: 0.5rem 1rem;
    background: var(--background-medium);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 150px;
}

.setting-select:focus,
.setting-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Admin Service Meta */
.admin-service-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* =====================================================
   INCIDENT UPDATE MODAL - PROFESSIONAL FLOW
   ===================================================== */

.modal-large {
    max-width: 700px;
    width: 95%;
}

.modal-small {
    max-width: 480px;
}

.modal-header-info {
    flex: 1;
}

.modal-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0 0;
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

/* Incident Summary Card */
.incident-summary-card {
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.incident-summary-row {
    display: flex;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.incident-summary-row:last-child {
    border-bottom: none;
}

.incident-summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 110px;
    font-weight: 500;
}

.incident-summary-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Incident History Section */
.incident-history-section {
    margin-bottom: 1.5rem;
}

.incident-history-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.incident-history-title svg {
    color: var(--primary-color);
}

/* Update Timeline */
.incident-update-timeline {
    position: relative;
    padding-left: 1.5rem;
}

.incident-update-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), var(--border-color));
    border-radius: 1px;
}

.timeline-item {
    position: relative;
    padding: 0.75rem 0 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -1.5rem;
    top: 1rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--background-dark);
    border: 3px solid var(--primary-color);
    z-index: 1;
}

.timeline-item.start .timeline-dot {
    border-color: var(--status-operational);
    background: var(--status-operational);
}

.timeline-item.investigating .timeline-dot {
    border-color: #3b82f6;
}

.timeline-item.identified .timeline-dot {
    border-color: #f59e0b;
}

.timeline-item.monitoring .timeline-dot {
    border-color: #8b5cf6;
}

.timeline-item.resolved .timeline-dot {
    border-color: var(--status-operational);
    background: var(--status-operational);
}

.timeline-content {
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.timeline-status {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.timeline-status.investigating { color: #3b82f6; background: rgba(59, 130, 246, 0.15); }
.timeline-status.identified { color: #f59e0b; background: rgba(245, 158, 11, 0.15); }
.timeline-status.monitoring { color: #8b5cf6; background: rgba(139, 92, 246, 0.15); }
.timeline-status.resolved { color: var(--status-operational); background: rgba(34, 197, 94, 0.15); }
.timeline-status.start { color: var(--text-muted); background: rgba(255, 255, 255, 0.1); }

.timeline-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timeline-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.timeline-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    background: var(--background-dark);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

/* New Update Form Section */
.incident-new-update-section {
    background: var(--background-medium);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
}

.incident-update-form .form-group {
    margin-bottom: 1.25rem;
}

.incident-update-form .form-group:last-child {
    margin-bottom: 0;
}

.incident-update-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

/* Status Buttons Group */
.status-buttons-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

@media (max-width: 600px) {
    .status-buttons-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

.status-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    background: var(--background-dark);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-btn:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
}

.status-btn.active {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.2);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.status-btn.investigating.active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.status-btn.identified.active {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.2);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.status-btn.monitoring.active {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.2);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.status-btn.resolved.active {
    border-color: var(--status-operational);
    background: rgba(34, 197, 94, 0.2);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.status-btn-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.status-btn-text {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
}

.status-btn.active .status-btn-text {
    color: var(--text-primary);
}

/* Form Hint */
.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

/* Form Actions Row */
.form-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

.form-actions-left,
.form-actions-right {
    display: flex;
    gap: 0.5rem;
}

.btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-with-icon svg {
    flex-shrink: 0;
}

/* Delete Confirmation Modal */
.modal-header-danger {
    background: rgba(239, 68, 68, 0.1);
    border-bottom-color: rgba(239, 68, 68, 0.3);
}

.modal-header-danger h3 {
    color: #ef4444;
}

.delete-confirm-content {
    text-align: center;
    padding: 1rem 0;
}

.delete-warning-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.delete-warning-text {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.delete-warning-details {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 1rem;
    text-align: left;
    margin-bottom: 1rem;
}

.delete-warning-details p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
}

.delete-warning-details ul {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.delete-warning-details li {
    margin-bottom: 0.25rem;
}

.delete-alternative {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: left;
}

.delete-confirm-actions {
    margin-top: 1.5rem;
    justify-content: center;
}

/* Admin Incident Item - Updated Styles */
.admin-incident-item {
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s ease;
}

.admin-incident-item:hover {
    border-color: var(--primary-color);
}

.admin-incident-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.admin-incident-info {
    flex: 1;
}

.admin-incident-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.admin-incident-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.admin-incident-meta .severity-badge {
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-badge.minor { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.severity-badge.major { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.severity-badge.critical { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.admin-incident-status-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.admin-incident-status-badge.investigating { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.admin-incident-status-badge.identified { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.admin-incident-status-badge.monitoring { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.admin-incident-status-badge.resolved { background: rgba(34, 197, 94, 0.2); color: var(--status-operational); }

.admin-incident-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-manage {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-manage:hover {
    background: var(--primary-dark);
}

.btn-manage svg {
    width: 14px;
    height: 14px;
}

/* Updates Preview */
.admin-incident-updates-preview {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.updates-preview-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.updates-preview-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =====================================================
   RESOLVED INCIDENTS SECTION
   ===================================================== */

.resolved-incidents-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.resolved-incident-item {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(34, 197, 94, 0.2);
    opacity: 0.9;
}

.resolved-incident-item:hover {
    opacity: 1;
    border-color: rgba(34, 197, 94, 0.4);
}

.resolved-incident-item .admin-incident-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.resolved-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
}

.resolved-incident-item .admin-incident-actions {
    flex-wrap: wrap;
    gap: 0.4rem;
}

.resolved-incident-item .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
}

.resolved-incident-item .btn svg {
    flex-shrink: 0;
}

.btn-warning {
    background: rgba(245, 158, 11, 0.9);
    color: #000;
    border: none;
}

.btn-warning:hover {
    background: #f59e0b;
}

/* Loading spinner for resolved section */
.resolved-incidents-container .loading {
    padding: 2rem;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.resolved-incidents-container .loading-spinner {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
}
