@import url('https://fonts.googleapis.com/css2?family=Chau+Philomene+One&family=Quicksand:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

h1, h2 {
    font-family: 'Chau Philomene One', serif;
}

h3, h4, h5, h6, p {
    font-family: 'Quicksand', sans-serif;
}

/* Error and status message styles */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin: 16px 0;
    text-align: center;
    font-family: 'Quicksand', sans-serif;
}

.no-doors-message {
    background-color: #d1ecf1;
    color: #0c5460;
    padding: 12px 16px;
    border: 1px solid #b8daff;
    border-radius: 8px;
    margin: 16px 0;
    text-align: center;
    font-family: 'Quicksand', sans-serif;
}

.header {
    background: linear-gradient(135deg, #ff6b3573, #f7931e);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
}

.nav-section {
    display: flex;
    gap: 1rem;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info-desktop {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-user-info {
    display: none;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.3);
}

.language-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-section label {
    font-size: 0.9rem;
    color: white;
}

.language-section select {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    border: none;
    background: rgba(255,255,255,0.9);
    color: #333;
}

.nav-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: rgba(255,255,255,0.4);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-btn {
    background: #fff;
    color: #ff6b35;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid white;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
}

#clear-session-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.5);
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#clear-session-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(180deg);
}

/* Hamburger menu styles */
.hamburger-btn {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    width: 30px;
    height: 25px;
    justify-content: space-between;
}

.hamburger-btn span {
    display: block;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h2 {
    color: #ff6b35;
    margin-bottom: 1rem;
    border-bottom: 2px solid #ff6b35;
    padding-bottom: 0.5rem;
}

.event-item {
    background: #f8f9fa;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    border-left: 4px solid #ff6b35;
}

.event-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.attendees {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.avatar-list {
    display: flex;
}

.avatar-list .chat-avatar {
    margin-left: -10px; /* Overlap avatars */
    border: 2px solid white;
}

.menu-item {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.menu-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.menu-description {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

.price {
    color: #ff6b35;
    font-weight: bold;
}

.chat-container {
    display: flex;
    height: 600px;
    gap: 1rem;
}

.chat-sidebar {
    width: 250px;
    background: white;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.chat-main {
    flex: 1;
    background: white;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.room-list {
    list-style: none;
}

.room-item {
    padding: 0.8rem;
    margin: 0.5rem 0;
    background: #f8f9fa;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.room-item:hover {
    background: #e9ecef;
}

.room-item.active {
    background: #ff6b35;
    color: white;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.message {
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.message-header {
    font-weight: bold;
    color: #ff6b35;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.chat-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

.message-input {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

#mention-autocomplete {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-bottom: none;
    max-height: 150px;
    overflow-y: auto;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.mention-item {
    padding: 0.5rem;
    cursor: pointer;
}

.mention-item:hover {
    background-color: #f0f0f0;
}

.message-input input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
}

.message-input button {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
}

.door-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.door-card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.door-card:hover {
    transform: translateY(-5px);
}

.door-btn {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1rem;
}

.door-btn:hover {
    background: #e55a2b;
    transform: scale(1.05);
}

.door-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.admin-section {
    margin-bottom: 2rem;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.user-table th,
.user-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.user-table th {
    background: #f8f9fa;
    font-weight: bold;
}

.btn {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    margin: 0.2rem;
}

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

.btn-danger {
    background: #dc3545;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 5vh auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    text-align: left;
    animation: slideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

/* Door access checkboxes styling */
#modal-door-access-checkboxes {
    min-height: 50px;
    padding: 10px 0;
}

#modal-door-access-checkboxes .form-group {
    margin-bottom: 10px;
    display: block;
    visibility: visible;
}

#modal-door-access-checkboxes .form-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

#modal-door-access-checkboxes .form-group input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.hidden {
    display: none !important;
}

.access-denied {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
}

/* Form help text styling */
.form-help {
    font-size: 0.85em;
    color: #666;
    margin-top: 0.25rem;
    display: block;
    font-style: italic;
}

@media (max-width: 768px) {
    .header {
        flex-direction: row;
        flex-wrap: wrap;
        position: relative;
    }

    .hamburger-btn {
        display: flex;
        order: 2;
    }

    .logo {
        order: 1;
        flex: 1;
    }

    .user-info-desktop {
        display: none !important;
    }

    .nav-buttons {
        order: 4;
        width: 100%;
        flex-direction: column;
        background: rgba(255, 107, 53, 0.95);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 1rem;
        border-radius: 0 0 10px 10px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
        gap: 0;
    }

    .nav-buttons.mobile-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-section {
        flex-direction: column;
        gap: 0;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.3);
    }

    .nav-section .nav-btn {
        margin: 0.5rem 0;
        width: 100%;
        text-align: center;
        padding: 1rem;
        font-size: 1.1rem;
    }

    .user-section {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .mobile-user-info {
        display: flex !important;
    }

    .user-section .nav-btn,
    .user-section .login-btn,
    .user-section .logout-btn {
        margin: 0.5rem 0;
        width: 100%;
        text-align: center;
        padding: 1rem;
        font-size: 1.1rem;
    }

    .language-section {
        justify-content: center;
        margin: 1rem 0;
        padding: 1rem;
        background: rgba(255,255,255,0.1);
        border-radius: 5px;
    }

    .language-section select {
        flex: 1;
        max-width: 200px;
        padding: 0.5rem;
        font-size: 1rem;
    }

    .chat-container {
        flex-direction: column;
        height: auto;
    }

    .chat-sidebar {
        width: 100%;
    }

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

    .container {
        padding: 1rem;
    }
}

/* Door utilities styling */
.door-utilities {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.door-utilities .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-secondary:hover {
    background-color: #545b62;
    border-color: #4e555b;
    transform: translateY(-1px);
}

/* Direct door access enhancements */
.door-card.highlighted {
    border: 2px solid #007bff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.direct-door-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #007bff;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-width: 300px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Login Method Tabs */
.login-method-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #ff6b35;
    background: rgba(255, 107, 53, 0.05);
}

.tab-button.active {
    color: #ff6b35;
    border-bottom-color: #ff6b35;
    background: rgba(255, 107, 53, 0.1);
}

/* WebAuthn Login Section */
.webauthn-login-content {
    text-align: center;
    padding: 30px 20px;
}

.webauthn-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.8;
}

.webauthn-login-content h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 1.3rem;
}

.webauthn-login-content p {
    margin-bottom: 25px;
    color: #666;
    line-height: 1.5;
}

#webauthn-login-btn {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

#webauthn-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

#webauthn-login-btn:active {
    transform: translateY(0);
}

.status-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* User Profile Modal Styles */
.user-profile-header {
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
}

.profile-avatar {
    display: block;
    margin: 0 auto;
}

.user-profile-details {
    margin-bottom: 1.5rem;
}

.profile-field {
    margin-bottom: 1rem;
}

.profile-field label {
    font-weight: bold;
    color: #555;
    display: block;
    margin-bottom: 0.25rem;
}

.profile-field p {
    color: #333;
    margin: 0;
    word-wrap: break-word;
}

.profile-field p:empty:before {
    content: "Not specified";
    color: #999;
    font-style: italic;
}

.user-profile-actions {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* Chat usernames clickable */
.chat-username {
    cursor: pointer;
    color: #f7931e;
    font-weight: bold;
}

.chat-username:hover {
    text-decoration: underline;
}

/* Chat avatar clickable */
.chat-avatar {
    cursor: pointer;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    margin-right: 0.5rem;
    object-fit: cover;
}

.chat-avatar:hover {
    opacity: 0.8;
}

/* Hide profile fields that are empty */
.profile-field:has(p:empty) {
    display: none;
}

/* Error Logging Dashboard Styles */
.error-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #f7931e;
}

.stat-card.critical {
    border-left-color: #dc3545;
}

.stat-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.error-filters {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-row select,
.filter-row input[type="search"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 150px;
}

.error-logs-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

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

.error-logs-table th,
.error-logs-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.error-logs-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.error-logs-table tr:hover {
    background: #f8f9fa;
}

.critical-error {
    background: #fff5f5 !important;
    border-left: 3px solid #dc3545;
}

.high-error {
    background: #fff9f0 !important;
    border-left: 3px solid #fd7e14;
}

.error-type-badge {
    background: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
}

.severity-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
}

.severity-low {
    background: #28a745;
}

.severity-medium {
    background: #ffc107;
    color: #333;
}

.severity-high {
    background: #fd7e14;
}

.severity-critical {
    background: #dc3545;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.resolved {
    background: #d4edda;
    color: #155724;
}

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

.message-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pagination {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid #eee;
}

.pagination button {
    margin: 0 0.5rem;
}

.large-modal .modal-content {
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
}

.error-details-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.detail-section {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
}

.detail-section h3 {
    margin: 0 0 1rem 0;
    color: #495057;
    font-size: 1.1rem;
    border-bottom: 2px solid #f7931e;
    padding-bottom: 0.5rem;
}

.detail-section p {
    margin: 0.5rem 0;
    line-height: 1.4;
}

.context-data {
    background: #f1f3f4;
    padding: 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.error-actions {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.error-actions textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5rem;
    font-family: inherit;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

/* Mobile responsiveness for error dashboard */
@media (max-width: 768px) {
    .error-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-row select,
    .filter-row input[type="search"] {
        min-width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .error-logs-table {
        font-size: 0.875rem;
    }
    
    .error-logs-table th,
    .error-logs-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .message-cell {
        max-width: 150px;
    }
    
    .large-modal .modal-content {
        width: 95%;
        padding: 1rem;
    }
    
    .error-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Error Logging Dashboard Styles */
.error-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #007bff;
}

.stat-card.critical {
    border-left-color: #dc3545;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.stat-card.critical .stat-number {
    color: #dc3545;
}

.error-filters {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

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

.filter-row select,
.filter-row input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.error-logs-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

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

.error-logs-table th {
    background: #f8f9fa;
    padding: 1rem 0.5rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.9rem;
}

.error-logs-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.85rem;
}

.error-logs-table tr:hover {
    background-color: #f8f9fa;
}

.error-logs-table tr.critical-error {
    background-color: #ffeaea;
}

.error-logs-table tr.high-error {
    background-color: #fff3cd;
}

.error-logs-table tr.resolved {
    opacity: 0.6;
}

.error-type-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #e9ecef;
    color: #495057;
}

.error-type-badge.rate_limit {
    background: #ffebee;
    color: #c62828;
}

.error-type-badge.api {
    background: #fff3e0;
    color: #ef6c00;
}

.error-type-badge.javascript {
    background: #f3e5f5;
    color: #7b1fa2;
}

.error-type-badge.network {
    background: #e8f5e8;
    color: #2e7d32;
}

.error-type-badge.authentication {
    background: #e1f5fe;
    color: #0277bd;
}

.severity-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.severity-badge.low {
    background: #e8f5e8;
    color: #2e7d32;
}

.severity-badge.medium {
    background: #fff3e0;
    color: #ef6c00;
}

.severity-badge.high {
    background: #ffebee;
    color: #c62828;
}

.severity-badge.critical {
    background: #b71c1c;
    color: white;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.resolved {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-badge.unresolved {
    background: #ffebee;
    color: #c62828;
}

.message-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pagination {
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin: 0 0.125rem;
}

.large-modal .modal-content {
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
}

.error-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.detail-section {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.detail-section h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1rem;
}

.detail-section p {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.detail-section strong {
    color: #555;
}

.context-data {
    background: #f1f3f4;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.error-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.error-actions textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
}

/* Responsive adjustments for error dashboard */
@media (max-width: 768px) {
    .error-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .filter-row select,
    .filter-row input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Mobile-optimized error table */
    .error-logs-container {
        overflow-x: auto;
    }
    
    .error-logs-table {
        font-size: 0.75rem;
        min-width: 100%;
    }
    
    .error-logs-table thead {
        display: none; /* Hide table headers on mobile */
    }
    
    .error-logs-table tbody {
        display: block;
    }
    
    .error-logs-table tr {
        display: block;
        background: white;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 0.5rem;
        padding: 0.75rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        cursor: pointer;
        transition: background-color 0.2s ease;
    }
    
    .error-logs-table tr:hover {
        background-color: #f8f9fa;
    }
    
    .error-logs-table tr.critical {
        border-left: 4px solid #dc3545;
    }
    
    .error-logs-table tr.high {
        border-left: 4px solid #fd7e14;
    }
    
    .error-logs-table tr.resolved {
        opacity: 0.7;
        background-color: #f8f9fa;
    }
    
    .error-logs-table td {
        display: block;
        padding: 0.25rem 0;
        border: none;
        position: relative;
    }
    
    .error-logs-table td:before {
        content: attr(data-label) ": ";
        font-weight: bold;
        color: #666;
        margin-right: 0.5rem;
    }
    
    /* Hide actions column on mobile, make row clickable instead */
    .error-logs-table td:last-child {
        display: none;
    }
    
    /* Add click indicator on mobile */
    .error-logs-table tr::after {
        content: "👆 Tap for details";
        position: absolute;
        top: 0.5rem;
        right: 0.75rem;
        font-size: 0.7rem;
        color: #007bff;
        font-weight: 500;
    }
    
    .message-cell {
        max-width: none;
    }
    
    .large-modal .modal-content {
        width: 95%;
        height: 90vh;
        padding: 1rem;
        overflow-y: auto;
        max-height: 90vh;
    }
    
    .error-details-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    /* Improve modal close button on mobile */
    .large-modal .close {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: white;
        border-radius: 50%;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
    }
    
    /* Error actions on mobile */
    .error-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 1rem;
        position: sticky;
        bottom: 0;
        background: white;
        padding: 1rem 0;
        border-top: 1px solid #e0e0e0;
    }
    
    .error-actions .btn {
        flex: 1;
        min-width: 120px;
        font-size: 14px;
    }
    
    #copy-error-btn {
        transition: all 0.3s ease;
    }
    
    /* Mobile-specific error list styling */
    .mobile-error-row {
        background: white;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 0.5rem;
        padding: 0.75rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .mobile-error-row:hover {
        background-color: #f8f9fa;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    
    .mobile-error-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.5rem;
    }
    
    .mobile-error-time {
        font-size: 0.75rem;
        color: #666;
        font-weight: 500;
    }
    
    .mobile-error-status {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }
    
    .mobile-error-message {
        margin-bottom: 0.5rem;
        line-height: 1.4;
    }
    
    .mobile-error-meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.75rem;
        color: #666;
    }
    
    .mobile-error-user {
        font-weight: 500;
    }
}
