/* Alert List Styles - Compact single-screen layout */

/* Block all scrolling on alert list page - desktop only */
@media (min-width: 769px) {
    html {
        overflow: hidden !important;
    }

    body {
        overflow: hidden !important;
        height: 100vh;
    }

    .content-blur {
        height: 100vh;
        overflow: hidden;
    }

    .main-content {
        overflow: hidden;
    }
}

:root {
    --primary-color: #4361ee;
    --primary-light: #e0e7ff;
    --secondary-color: #3a0ca3;
    --accent-color: #f72585;
    --text-color: #2b2d42;
    --text-light: #6c757d;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e9ecef;
    --success-color: #4cc9f0;
    --warning-color: #7c8db0;
    --danger-color: #ef233c;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --border-radius: 12px;
    --border-radius-sm: 6px;
    --transition: none;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* Override content-blur for alert list page */
.content-blur {
    display: flex;
    flex-direction: column;
}

/* Override main-content for alert list page */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: transparent;
}

/* Override footer for alert list page */
.main-footer {
    flex-shrink: 0;
    margin-top: 0 !important;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.25rem 2rem 0.5rem;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: transparent;
}
.alerts-header {
    background: linear-gradient(135deg, #2b2d42 0%, #353850 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.header-content h1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    margin: 0 0 0.35rem 0;
    font-weight: 700;
    color: white;
}

.header-content h1 svg {
    width: 30px;
    height: 30px;
}

.header-content p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
    color: white;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: #2b2d42;
    color: white;
}

.btn-primary:hover {
    background: #1a1c2c;
    box-shadow: 0 0.25rem 0.75rem rgba(43, 45, 66, 0.3);
}

/* Create Alert button - disable all animations and focus states */
.btn-new-alert {
    animation: none !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    will-change: auto !important;
    perspective: none !important;
    backface-visibility: visible !important;
}

.btn-new-alert:hover {
    animation: none !important;
    transform: none !important;
    transition: none !important;
    background: #2b2d42;
    box-shadow: 0 0.25rem 0.75rem rgba(43, 45, 66, 0.3);
}

.btn-new-alert:focus {
    outline: none;
    background: #2b2d42;
    box-shadow: none;
    animation: none !important;
    transform: none !important;
}

.btn-new-alert:focus-visible {
    outline: 2px solid #4361ee;
    outline-offset: 2px;
}

.btn-new-alert:active {
    transform: none !important;
    animation: none !important;
    background: #2b2d42;
}

.alerts-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.stat-item {
    background: white;
    padding: 1.25rem 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
    border: none;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-item:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    color: white;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 26px;
    height: 26px;
}

.stat-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.stat-number {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-top: 5px;
}

/* Stat Card Styles (for alert summary) - same as statistics page */
.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border: none;
    opacity: 0;
    transform: translateY(10px);
}

.stat-card.fade-in-delayed {
    animation: none;
}

.stat-card.fade-in-delayed.show {
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: var(--delay, 0ms);
}

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

/* Stat card icon styles with gradient colors */
.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    color: white;
    flex-shrink: 0;
}

.stat-card .stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-icon.primary {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
}

.stat-icon.success {
    background: linear-gradient(135deg, #ef233c 0%, #d62828 100%);
}

.stat-icon.info {
    background: linear-gradient(135deg, #FFD700 0%, #FFC107 100%);
}

.stat-icon.warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #6b7aa3 100%);
}

.stat-icon.danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #f72585 100%);
}

/* Alert summary section layout */
.alerts-stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Set animation delay for each stat card */
#alerts-summary-actual .stat-card:nth-child(1) { --delay: 0ms; }
#alerts-summary-actual .stat-card:nth-child(2) { --delay: 40ms; }
#alerts-summary-actual .stat-card:nth-child(3) { --delay: 80ms; }

/* Fade-in-up animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alerts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
    flex: 1;
    overflow: auto;
    padding-right: 10px;
}

.alert-card {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.12);
    border: 1px solid #e9ecef;
    height: fit-content;
    color: #2b2d42;
}

.alert-card:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.12);
}

.alert-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
    gap: 0.65rem;
}

.alert-title-section {
    flex: 1;
    min-width: 0;
}

.alert-title-section h3 {
    margin: 0 0 0.45rem 0;
    color: #2b2d42;
    font-size: 1.05rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-status {
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.alert-status.active {
    background: #d1fae5;
    color: #065f46;
}

.alert-status.inactive {
    background: #fee2e2;
    color: #b91c1c;
}

.alert-phone {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: var(--border-radius-sm);
}

.alert-phone svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.alert-criteria {
    margin-bottom: 0.8rem;
}

.criterion {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.criterion-icon {
    width: 20px;
    text-align: center;
    color: #4361ee;
    flex-shrink: 0;
}

.criterion-icon svg {
    width: 16px;
    height: 16px;
}

.criterion-label {
    flex: 1;
    font-weight: 500;
    color: #6c757d;
    font-size: 0.825rem;
}

.criterion-value {
    font-weight: 600;
    color: #2b2d42;
    text-align: right;
    font-size: 0.825rem;
}

.alert-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-action {
    padding: 7px 14px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;

}

.btn-action svg {
    width: 15px;
    height: 15px;
}

.btn-test {
    background: #4361ee;
    color: #ffffff;
}

.btn-test:hover {
    background: #3451d6;
    transform: translateY(-1px);
}

.btn-edit {
    background: #0ea5e9;
    color: #ffffff;
}

.btn-edit:hover {
    background: #0284c7;
    transform: translateY(-1px);
}

.btn-delete {
    background: #ef233c;
    color: #ffffff;
}

.btn-delete:hover {
    background: #d62828;
    transform: translateY(-1px);
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    grid-column: 1 / -1;
    box-shadow: var(--shadow-sm);
}

.empty-icon {
    margin-bottom: 1rem;
    opacity: 0.7;
}

.empty-icon svg {
    width: 48px;
    height: 48px;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-size: 1.3rem;
    font-weight: 600;
}

.empty-state p {
    color: var(--text-light);
    margin: 0 0 1.5rem 0;
    font-size: 0.95rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 1200px) {
    .alerts-header {
        width: 100%;
    }
    .alerts-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 768px) {
    html, body {
        overflow: auto !important;
        height: auto;
    }

    .app-container {
        padding: 1rem;
        height: auto;
        overflow: visible;
    }

    .alerts-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }

    .header-content h1 {
        font-size: 1.6rem;
    }
    
    .header-content h1 svg {
        width: 28px;
        height: 28px;
    }
    
    .header-content p {
        font-size: 0.9rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        padding: 0.8rem 1.2rem;
        font-size: 0.95rem;
    }

    .alerts-stats, .alerts-stats-summary {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-item, .stat-card {
        padding: 1rem;
        flex-direction: row;
        align-items: center;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
    }
    
    .stat-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .stat-number {
        font-size: 1.6rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }

    .alerts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        overflow: visible;
        padding-right: 0;
    }

    .alert-card {
        padding: 1rem;
    }

    .alert-card-header {
        flex-direction: column;
        gap: 0.6rem;
        align-items: flex-start;
    }
    
    .alert-title-section h3 {
        font-size: 1.1rem;
    }

    .alert-card-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .btn-action {
        flex-grow: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 0.75rem;
    }
    
    .alerts-header {
        gap: 0.75rem;
        margin-bottom: 1rem;
        padding: 0.9rem;
    }
    
    .header-content h1 {
        font-size: 1.4rem;
    }
    
    .header-content h1 svg {
        width: 24px;
        height: 24px;
    }
    
    .header-content p {
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn svg {
        width: 18px;
        height: 18px;
    }
    
    .alerts-stats, .alerts-stats-summary {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .stat-item, .stat-card {
        padding: 0.75rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
    }
    
    .stat-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .stat-number {
        font-size: 1.4rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .alert-card {
        padding: 0.75rem;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .alert-card-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .alert-title-section h3 {
        font-size: 0.95rem;
        margin: 0;
    }
    
    .alert-status {
        font-size: 0.65rem;
        padding: 4px 8px;
    }
    
    .alert-phone {
        font-size: 0.75rem;
    }
    
    .criterion-label,
    .criterion-value {
        font-size: 0.75rem;
    }
    
    .alert-card-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }
    
    .btn-action {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
        flex: 1;
        min-width: 60px;
    }
    
    .btn-action svg {
        width: 16px;
        height: 16px;
    }

    /* Allow scrolling on mobile devices - FULLY OVERRIDE desktop styles */
    html {
        overflow: auto !important;
        height: auto !important;
        overflow-x: hidden !important;
    }

    body {
        overflow: auto !important;
        overflow-x: hidden !important;
        height: auto !important;
        min-height: 100vh;
    }

    .content-blur {
        height: auto !important;
        overflow: visible !important;
        min-height: 100vh;
    }

    .main-content {
        overflow: visible !important;
        min-height: auto;
        margin-top: 3.75rem;
    }

    .app-container {
        overflow: visible !important;
        padding: 0.5rem 0.75rem;
        height: auto;
    }

    .alerts-grid {
        grid-template-columns: 1fr;
    }

    .alert-card {
        min-height: auto;
        height: auto;
    }
}
