/**
 * Tracking Notifications - Themed CSS
 * Matches HubEurope Partner Portal Design System
 */

/* Import CSS variables from site theme */
:root {
    /* These match /assets/css/site.css */
    --brand-orange: #FF4400;
    --brand-orange-2: #E63D00;
    --white: #FFFFFF;
    --off-white: #F9FAFB;
    --light-gray: #F3F4F6;
    --black-80: rgba(0, 0, 0, 0.8);
    --gray-50: #808080;
    --gray-70: #4D4D4D;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* ============================================
   MODAL - Matching Partner Portal Style
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--white);
    border: 4px solid #FF4400;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideDown 0.3s;
}

.modal-large {
    max-width: 900px;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 2px solid var(--light-gray);
    background: linear-gradient(to bottom, var(--white), var(--off-white));
}

.modal-header h2 {
    margin: 0;
    color: var(--black-80);
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i {
    color: var(--brand-orange);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 2px solid transparent;
    color: var(--gray-50);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--light-gray);
    color: var(--black-80);
    border-color: var(--gray-50);
}

/* ============================================
   FORM ELEMENTS - Partner Portal Style
   ============================================ */

.modal form {
    padding: 30px;
}

.form-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: block;
    color: var(--black-80);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    box-sizing: border-box;
    background: var(--white);
    color: var(--black-80);
    border: 2px solid #E5E7EB;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
    transition: all 0.15s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 3px rgba(255, 68, 0, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-50);
}

.form-group small {
    display: block;
    clear: both;
    margin-top: 8px;
    font-size: 12px;
    color: var(--gray-50);
    width: 100%;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Checkbox styling */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 12px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.checkbox-label:hover {
    background: var(--off-white);
}

.checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--brand-orange);
}

.checkbox-label span {
    flex: 1;
    color: var(--black-80);
    font-size: 14px;
}

/* ============================================
   MODAL ACTIONS - Partner Portal Buttons
   ============================================ */

.modal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px 30px;
    border-top: 2px solid var(--light-gray);
    background: var(--off-white);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    outline: none;
}

.btn-primary {
    background: var(--brand-orange);
    color: var(--white);
    box-shadow: 0 2px 4px rgba(255, 68, 0, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: var(--brand-orange-2);
    box-shadow: 0 4px 8px rgba(255, 68, 0, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--white);
    color: var(--black-80);
    border-color: #E5E7EB;
}

.btn-secondary:hover {
    background: var(--light-gray);
    border-color: var(--gray-50);
}

.btn-secondary:active {
    transform: translateY(1px);
}

/* ============================================
   PAGE LAYOUT
   ============================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light-gray);
}

.header-left .back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-50);
    text-decoration: none;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s;
}

.header-left .back-link:hover {
    color: var(--brand-orange);
}

.page-header h1 {
    margin: 10px 0 5px 0;
    color: var(--black-80);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h1 i {
    color: var(--brand-orange);
}

.page-header .subtitle {
    color: var(--gray-50);
    margin: 0;
    font-size: 15px;
}

/* ============================================
   STATISTICS CARDS
   ============================================ */

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

.stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 36px;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-success .stat-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-info .stat-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.stat-warning .stat-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-danger .stat-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
    color: var(--black-80);
}

.stat-label {
    color: var(--gray-50);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ============================================
   CARD COMPONENT
   ============================================ */

.card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid var(--light-gray);
    background: linear-gradient(to bottom, var(--white), var(--off-white));
}

.card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--black-80);
}

/* ============================================
   FILTER BUTTONS
   ============================================ */

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

.btn-filter {
    padding: 8px 16px;
    border: 2px solid #E5E7EB;
    background: var(--white);
    color: var(--gray-70);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-filter:hover {
    border-color: var(--brand-orange);
    color: var(--brand-orange);
}

.btn-filter.active {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    color: var(--white);
}

/* ============================================
   TABLE STYLING
   ============================================ */

.table-responsive {
    overflow-x: auto;
}

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

.watchlist-table thead {
    background: var(--off-white);
}

.watchlist-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    color: var(--gray-70);
    border-bottom: 2px solid var(--light-gray);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.watchlist-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--light-gray);
    vertical-align: middle;
    color: var(--black-80);
    font-size: 14px;
}

.watchlist-table tbody tr {
    transition: background-color 0.15s;
}

.watchlist-table tbody tr:hover {
    background-color: var(--off-white);
}

/* ============================================
   STATUS BADGES
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-badge.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-badge.status-disabled {
    background: rgba(128, 128, 128, 0.1);
    color: var(--gray-50);
}

.status-badge.status-sent {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-badge.status-failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.company-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 68, 0, 0.1);
    color: var(--brand-orange);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.more-count {
    display: inline-block;
    padding: 2px 8px;
    background: var(--light-gray);
    color: var(--gray-70);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}

.notify-level {
    display: inline-block;
    margin-left: 8px;
    padding: 4px 8px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}

.disabled-reason {
    margin-top: 4px;
    font-size: 12px;
    color: var(--gray-50);
    font-style: italic;
}

.last-status {
    font-size: 12px;
    color: var(--gray-50);
    margin-top: 4px;
}

.expires-soon {
    color: var(--warning);
    font-weight: 600;
}

.expiry-warning {
    font-size: 11px;
    color: var(--warning);
    font-weight: 700;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.actions-cell {
    white-space: nowrap;
}

.btn-icon {
    width: 34px;
    height: 34px;
    border: 2px solid #E5E7EB;
    background: var(--white);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    margin: 0 2px;
    color: var(--gray-70);
}

.btn-icon:hover {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-icon.btn-success:hover {
    background: var(--success);
    border-color: var(--success);
}

.btn-icon.btn-warning:hover {
    background: var(--warning);
    border-color: var(--warning);
}

.btn-icon.btn-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-row td {
    text-align: center;
    padding: 60px 20px !important;
}

.empty-row i {
    font-size: 64px;
    color: var(--light-gray);
    display: block;
    margin-bottom: 16px;
}

.empty-row p {
    color: var(--gray-50);
    font-size: 15px;
    margin: 12px 0;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center { text-align: center; }
.text-muted { color: var(--gray-50); }
.notifications-count {
    font-weight: 700;
    color: var(--brand-orange);
    font-size: 16px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 15px;
    }

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

    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .filter-buttons {
        flex-wrap: wrap;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .modal form {
        padding: 20px;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-actions {
        padding: 16px 20px;
        flex-direction: column-reverse;
    }

    .modal-actions .btn-primary,
    .modal-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .watchlist-table {
        font-size: 13px;
    }

    .watchlist-table th,
    .watchlist-table td {
        padding: 12px;
    }
}

/* ============================================
   TRACKING PAGE - Notify Button (removed - now uses .control-btn)
   ============================================ */

.success-message {
    text-align: center;
    padding: 40px 30px;
}

.success-message i {
    font-size: 64px;
    color: var(--success);
    margin-bottom: 20px;
    display: block;
}

.success-message h3 {
    color: var(--success);
    margin: 10px 0;
    font-size: 24px;
}

.success-message p {
    color: var(--black-80);
    margin: 8px 0;
}

.success-message strong {
    color: var(--brand-orange);
    font-family: 'Courier New', monospace;
}

.popup-subtitle {
    text-align: center;
    padding: 0 0 20px;
    color: var(--gray-70);
    font-size: 15px;
}

.popup-subtitle strong {
    font-family: 'Courier New', monospace;
    color: var(--brand-orange);
    font-weight: 700;
}

.notification-settings {
    padding: 20px 0;
}

.notification-settings h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--black-80);
    font-weight: 700;
}

.privacy-notice {
    background: rgba(255, 68, 0, 0.05);
    border-left: 4px solid var(--brand-orange);
    padding: 12px;
    margin: 20px 0 0;
    border-radius: var(--radius-sm);
}

.privacy-notice small {
    color: var(--gray-70);
    display: flex;
    align-items: center;
    gap: 8px;
}

.privacy-notice i {
    color: var(--brand-orange);
}

/* Mobile styles for notify button removed - now uses .control-btn from tracking-styles.css */

/* ============================================
   BELL RINGING ANIMATION
   ============================================ */

.bell-icon {
    display: inline-block;
    animation: bellRing 2s ease-in-out infinite;
    transform-origin: 50% 0%;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(15deg); }
    20% { transform: rotate(-15deg); }
    30% { transform: rotate(10deg); }
    40% { transform: rotate(-10deg); }
    50% { transform: rotate(0deg); }
    /* Rest for second half of animation */
}
