/**
 * Server Monitor Dashboard Styles
 * Modern dark theme with glassmorphism effects
 */

:root {
    --sm-bg-primary: #0f1419;
    --sm-bg-secondary: #1a1f2e;
    --sm-bg-card: rgba(26, 31, 46, 0.6);
    --sm-border-primary: #2ecc71;
    --sm-border-secondary: rgba(46, 204, 113, 0.3);
    --sm-text-primary: #ffffff;
    --sm-text-secondary: #a0aec0;
    --sm-text-muted: #718096;
    --sm-status-online: #2ecc71;
    --sm-status-offline: #e74c3c;
    --sm-accent-green: #2ecc71;
    --sm-accent-yellow: #f39c12;
    --sm-accent-red: #e74c3c;
}

/* Dashboard Container */
.server-monitor-dashboard {
    padding: 2rem 0;
    min-height: 400px;
}

/* Grid Layout */
.server-monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (max-width: 768px) {
    .server-monitor-grid {
        grid-template-columns: 1fr;
    }
}

/* Server Card */
.server-card {
    background: var(--sm-bg-card);
    backdrop-filter: blur(10px);
    border: 2px solid var(--sm-border-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.server-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--sm-border-primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.server-card:hover {
    border-color: var(--sm-border-primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(46, 204, 113, 0.15);
}

.server-card:hover::before {
    opacity: 1;
}

/* Card Header */
.server-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.server-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 8px;
    color: var(--sm-accent-green);
    flex-shrink: 0;
}

.server-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--sm-text-primary);
    margin: 0;
    flex: 1;
}

.server-status-badge {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.server-status-badge.online {
    background: rgba(46, 204, 113, 0.15);
    color: var(--sm-status-online);
}

.server-status-badge.offline {
    background: rgba(231, 76, 60, 0.15);
    color: var(--sm-status-offline);
}

.status-icon {
    flex-shrink: 0;
}

/* Stability */
.server-stability {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stability-label {
    font-size: 0.875rem;
    color: var(--sm-text-secondary);
}

.stability-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--sm-accent-green);
}

/* Channel Analysis */
.channel-analysis {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.channel-analysis.pending {
    background: rgba(255, 255, 255, 0.03);
}

.analysis-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--sm-text-primary);
    transition: all 0.3s ease;
}

.analysis-toggle:hover {
    color: var(--sm-accent-green);
}

.analysis-toggle .icon-pulse {
    color: var(--sm-accent-green);
    flex-shrink: 0;
}

.analysis-title {
    font-size: 0.875rem;
    font-weight: 500;
    flex: 1;
    text-align: left;
}

.analysis-hint {
    font-size: 0.75rem;
    color: var(--sm-text-muted);
    font-style: italic;
}

.analysis-toggle .icon-chevron {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.analysis-toggle[data-expanded="true"] .icon-chevron {
    transform: rotate(180deg);
}

.analysis-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.stat-label {
    color: var(--sm-text-secondary);
}

.stat-value {
    color: var(--sm-text-primary);
    font-weight: 500;
}

.stat-value.stat-online {
    color: var(--sm-accent-green);
}

.stat-value.stat-offline {
    color: var(--sm-accent-yellow);
}

/* Analysis Pending */
.analysis-pending {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.analysis-status-text {
    font-size: 0.875rem;
    color: var(--sm-text-muted);
    font-style: italic;
    margin: 0.5rem 0;
}

.analysis-verification {
    font-size: 0.75rem;
    color: var(--sm-text-secondary);
    margin: 0;
}

/* Report Button */
.report-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--sm-text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.report-button:hover {
    background: rgba(46, 204, 113, 0.1);
    border-color: var(--sm-accent-green);
    color: var(--sm-accent-green);
}

.report-button svg {
    flex-shrink: 0;
}

/* Recent Reports Alert */
.recent-reports-alert {
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(243, 156, 18, 0.08);
    border: 1px solid rgba(243, 156, 18, 0.3);
    border-radius: 12px;
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.alert-header svg:first-child {
    color: var(--sm-accent-yellow);
    flex-shrink: 0;
}

.warning-icon {
    color: var(--sm-accent-yellow);
    flex-shrink: 0;
}

.alert-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sm-accent-yellow);
    flex: 1;
}

.report-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.report-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    font-size: 0.8125rem;
    color: var(--sm-text-secondary);
}

.report-bullet {
    color: var(--sm-accent-yellow);
    font-size: 0.625rem;
    flex-shrink: 0;
}

.report-text {
    flex: 1;
}

.report-item strong {
    color: var(--sm-text-primary);
    font-weight: 600;
}

/* Downtime Indicator */
.downtime-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem;
    background: rgba(46, 204, 113, 0.05);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--sm-accent-green);
}

.downtime-indicator svg {
    flex-shrink: 0;
}

/* Modal */
.sm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.sm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.sm-modal-content {
    position: relative;
    background: #2c3544;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.sm-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header-icon {
    width: 24px;
    height: 24px;
    color: var(--sm-accent-green);
    flex-shrink: 0;
}

.sm-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--sm-text-primary);
    flex: 1;
}

.sm-modal-close {
    background: none;
    border: none;
    color: var(--sm-text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.sm-modal-close:hover {
    color: var(--sm-text-primary);
}

.sm-modal-body {
    padding: 1rem 1.5rem;
}

/* Server Info Display */
.server-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.server-label {
    font-size: 0.875rem;
    color: var(--sm-text-secondary);
}

.server-name-display {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sm-text-primary);
}

/* Problem Types Section */
.problem-types-section {
    margin-bottom: 1.5rem;
}

.section-label {
    display: block;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sm-text-primary);
}

.radio-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.radio-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(46, 204, 113, 0.3);
}

.radio-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    margin-right: 0.75rem;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked {
    border-color: var(--sm-accent-green);
    background: rgba(46, 204, 113, 0.1);
}

.radio-option input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--sm-accent-green);
    border-radius: 50%;
}

.radio-option input[type="radio"]:checked~.radio-label {
    color: var(--sm-text-primary);
}

.radio-option:has(input[type="radio"]:checked) {
    background: rgba(46, 204, 113, 0.08);
    border-color: var(--sm-accent-green);
}

.radio-label {
    font-size: 0.875rem;
    color: var(--sm-text-secondary);
    cursor: pointer;
    transition: color 0.3s ease;
}

.sm-modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Form Elements */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sm-text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--sm-text-primary);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--sm-accent-green);
    background: rgba(255, 255, 255, 0.08);
}

.form-control::placeholder {
    color: var(--sm-text-muted);
}

.form-text {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--sm-text-muted);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit,
.btn-primary {
    background: var(--sm-accent-green);
    color: #ffffff;
}

.btn-submit:hover,
.btn-primary:hover {
    background: #27ae60;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.btn-submit:disabled {
    background: rgba(46, 204, 113, 0.3);
    cursor: not-allowed;
    transform: none;
}

.btn-cancel,
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--sm-text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-cancel:hover,
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Form Message */
.sm-form-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
}

.sm-form-message.success {
    background: rgba(46, 204, 113, 0.15);
    color: var(--sm-accent-green);
    border: 1px solid var(--sm-accent-green);
}

.sm-form-message.error {
    background: rgba(231, 76, 60, 0.15);
    color: var(--sm-accent-red);
    border: 1px solid var(--sm-accent-red);
}

.sm-form-message.info {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
    border: 1px solid #3498db;
}

/* Disabled Report Button */
.report-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
    color: var(--sm-text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.report-button.disabled:hover {
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.05);
}

/* Empty State */
.server-monitor-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--sm-text-muted);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.server-card {
    animation: fadeIn 0.4s ease-out;
}

.server-card:nth-child(1) {
    animation-delay: 0.1s;
}

.server-card:nth-child(2) {
    animation-delay: 0.2s;
}

.server-card:nth-child(3) {
    animation-delay: 0.3s;
}