/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Layout */
#app {
    min-height: 100vh;
}

.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

/* Login Screen */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #667eea;
}

.logo p {
    color: #666;
    font-size: 1.1rem;
}

.logo-links {
    margin-top: 1rem;
}

.logo-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.logo-link:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

/* Navigation */
.navbar {
    background: white;
    border-bottom: 1px solid #e1e5e9;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-brand h2 {
    color: #667eea;
    font-size: 1.5rem;
}

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

.nav-link {
    text-decoration: none;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-link:hover {
    background-color: #f8f9fa;
    color: #333;
}

.nav-link.active {
    background-color: #667eea;
    color: white;
}

.docs-link {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0.75rem;
}

.docs-link:hover {
    color: var(--primary);
}

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

.nav-user span {
    color: #666;
    font-weight: 500;
}

/* Main Content */
.main-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Dashboard */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.dashboard-header p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: #666;
    font-size: 0.9rem;
}

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

.dashboard-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-card h3 {
    margin-bottom: 1rem;
    color: #333;
}

.health-status {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.health-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.health-label {
    font-weight: 500;
    color: #666;
}

.health-value {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

.health-value.health-operational {
    background: #d4edda;
    color: #155724;
}

.health-value.health-unknown {
    background: #fff3cd;
    color: #856404;
}

.integration-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.integration-type-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.integration-type-icon {
    font-size: 1.2rem;
}

.integration-type-name {
    flex: 1;
    font-weight: 500;
}

.integration-type-count {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Tab Headers */
.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.tab-header h1 {
    font-size: 2rem;
    color: #333;
}

.tab-actions {
    display: flex;
    gap: 1rem;
}

/* Widgets */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.widget-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.widget-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.widget-title h4 {
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 1.2rem;
}

.widget-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.widget-id {
    color: #666;
    font-size: 0.85rem;
    font-family: 'Monaco', 'Menlo', monospace;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.widget-date {
    color: #666;
    font-size: 0.9rem;
}

.widget-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    margin-top: 12px;
}

.widget-actions .actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.widget-delete-button {
    background-color: #dc3545;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.widget-delete-button:hover {
    background-color: #c82333;
}

.widget-integrations {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e1e5e9;
}

.widget-integrations label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.integration-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 24px;
}

.no-integrations {
    color: #999;
    font-style: italic;
    font-size: 0.9rem;
}

.widget-stats {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    border-top: 1px solid #e1e5e9;
    margin-top: auto;
}

.widget-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-weight: bold;
    color: #667eea;
}

.widget-api-key {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e1e5e9;
}

.widget-api-key label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #666;
}

/* Warning Box */
.warning-box {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.warning-box h3 {
    color: #856404;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.warning-box p {
    color: #856404;
    margin: 0;
}

/* Close button for warning boxes */
.warning-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #856404;
    font-size: 1.1rem;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
}

.warning-close:hover {
    background: rgba(133, 100, 4, 0.1);
}

/* API Key Modal */
.api-key-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.api-key-display {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    border: 1px solid #e1e5e9;
    flex: 1;
    word-break: break-all;
}

.id-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 100%;
    overflow: hidden;
}

.id-container code {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.api-key-display,
.widget-id-display {
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.widget-id-display {
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    border: 1px solid #e1e5e9;
}

.widget-name-display {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

/* Removed duplicate widget-integrations styles */

/* Integrations */
.integrations-section {
    margin-bottom: 2rem;
}

.integration-types-info {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.integration-types-info h3 {
    margin-bottom: 1rem;
    color: #333;
}

.integration-type-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.integration-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.integration-header {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 0 0 auto;
}

.integration-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.integration-icon {
    font-size: 2rem;
}

.integration-info h4 {
    margin-bottom: 0.25rem;
    color: #333;
}

.integration-date {
    color: #666;
    font-size: 0.9rem;
}

.integration-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 0 1.5rem; /* align with details/status left padding */
}

/* Group that holds actions, details, and status; sits at the bottom */
.integration-meta {
    margin-top: auto; /* push group to bottom of card */
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* spacing between actions, details, and status */
}

/* Create a single flexible gap above the bottom group via auto top margin on .integration-meta */

.integration-details {
    padding: 0.75rem 1.5rem;
    background: #f8f9fa;
}

.param-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.param-item:last-child {
    margin-bottom: 0;
}

.param-item label {
    font-weight: 500;
    color: #666;
}

.param-item span {
    color: #333;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
}

.integration-status {
    padding: 0.5rem 1.5rem;
    border-top: 1px solid #e1e5e9;
}

.status-indicator {
    font-size: 0.9rem;
    font-weight: 500;
}

.status-active {
    color: #28a745;
}

/* Feedback */
.feedback-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

/* Feedback filter controls */
#feedback-widget-filter {
    min-width: 260px;
}

#feedback-widget-filter[multiple] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    height: 120px;
    /* reduced height per request */
    overflow: auto;
}

#feedback-widget-filter:focus,
#feedback-widget-filter[multiple]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#feedback-widget-filter option {
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
}

/* Selected state for multiple select */
#feedback-widget-filter[multiple] option:checked {
    background-color: #667eea !important;
    color: #fff;
}

/* Subtle hover for options (not all browsers support option:hover) */
#feedback-widget-filter[multiple] option:hover {
    background-color: #eef0ff;
}

/* Narrow scrollbar to match compact UI */
#feedback-widget-filter[multiple]::-webkit-scrollbar {
    width: 8px;
}

#feedback-widget-filter[multiple]::-webkit-scrollbar-thumb {
    background: #d7dbef;
    border-radius: 8px;
}

#feedback-widget-filter[multiple]::-webkit-scrollbar-thumb:hover {
    background: #c3c9ea;
}

/* Items per page select to match UI */
#feedback-limit {
    width: auto;
    min-width: 140px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
}

#feedback-limit:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: #666;
}

.feedback-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.feedback-item {
    padding: 1.5rem;
    border-bottom: 1px solid #e1e5e9;
}

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

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

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

.star-rating {
    color: #ffc107;
    font-size: 1.2rem;
}

.rating-number {
    color: #666;
    font-weight: 500;
}

.feedback-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: right;
}

.feedback-widget {
    color: #667eea;
    font-weight: 500;
    font-size: 0.9rem;
}

.feedback-date {
    color: #666;
    font-size: 0.9rem;
}

.feedback-text {
    margin-bottom: 1rem;
}

.feedback-text p {
    color: #333;
    font-style: italic;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #667eea;
}

.feedback-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Chips for selected widgets */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f1f3fb;
    color: #333;
    border: 1px solid #dfe3f3;
    border-radius: 999px;
    padding: 0.35rem 0.6rem 0.35rem 0.75rem;
    font-size: 0.9rem;
}

.chip-label {
    font-weight: 500;
}

.chip-remove {
    background: transparent;
    border: none;
    color: #667eea;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}

.chip-remove:hover {
    background: rgba(102, 126, 234, 0.12);
}

.pagination {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pagination-controls .btn {
    min-width: 120px;
}

.pagination-controls .btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.pagination-info {
    color: #666;
    font-weight: 500;
}

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

.chart-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
    margin-bottom: 1rem;
    color: #333;
}

.chart-placeholder {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 4px;
    padding: 2rem;
    text-align: center;
    color: #666;
}

.chart-placeholder p {
    margin-bottom: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: #666;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.checkbox-item:hover {
    background-color: #f8f9fa;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-label {
    flex: 1;
    font-weight: 500;
}

.no-integrations {
    color: #666;
    font-style: italic;
}

.no-integrations a {
    color: #667eea;
    text-decoration: none;
}

.no-integrations a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

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

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #5a6fd8;
}

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

.btn-success:hover:not(:disabled) {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.btn-copy {
    border: 1px solid #6c757d;
    color: #6c757d;
    background: transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-copy:hover {
    background-color: #6c757d;
    color: white;
}

.btn-delete {
    border: 1px solid #dc3545;
    color: #dc3545;
    background: transparent;
    transition: all 0.2s;
}

.btn-delete:hover {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c82333;
}

.btn-outline {
    background-color: transparent;
    color: #667eea;
    border: 1px solid #667eea;
}

.btn-outline:hover:not(:disabled) {
    background-color: #667eea;
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

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

.badge-jira {
    background: #0052cc;
    color: white;
}

.badge-slack {
    background: #4a154b;
    color: white;
}

.badge-webhook {
    background: #6c757d;
    color: white;
}

.badge-email {
    background: #17a2b8;
    color: white;
}

.badge-teams {
    background: #6264a7;
    color: white;
}

.badge-discord {
    background: #7289da;
    color: white;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: block;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content.large {
    max-width: 800px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.close {
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close:hover {
    background-color: #f8f9fa;
    color: #333;
}

.modal-body {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
}

.modal form {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e1e5e9;
    margin-top: 0;
}

body.modal-open {
    overflow: hidden;
}

/* Widget Details */
.widget-details {
    padding: 1.5rem;
}

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

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h3 {
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item label {
    font-weight: 500;
    color: #666;
    font-size: 0.9rem;
}

.detail-item span {
    color: #333;
    font-weight: 500;
}

.api-key-section {
    margin-bottom: 1rem;
}

.api-key-section label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #666;
}

.api-key-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.api-key-full {
    flex: 1;
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    word-break: break-all;
}

.api-usage h4 {
    margin-bottom: 0.5rem;
    color: #333;
}

.code-block {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    color: #333;
}

.stats-grid .stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.integrations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.integration-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.integration-icon {
    font-size: 1.5rem;
}

.integration-info {
    flex: 1;
}

.integration-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

.integration-details {
    color: #666;
    font-size: 0.9rem;
    font-family: 'Monaco', 'Menlo', monospace;
}

/* Empty and Error States */
.empty-state,
.error-state {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.empty-icon,
.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3,
.error-state h3 {
    margin-bottom: 1rem;
    color: #333;
}

.empty-state p,
.error-state p {
    color: #666;
    margin-bottom: 2rem;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    margin: 0;
    color: #666;
    font-weight: 500;
}

/* Floating Feedback Widget */
.floating-feedback {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.feedback-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.feedback-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.feedback-trigger .tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.feedback-trigger:hover .tooltip {
    opacity: 1;
}

.feedback-trigger .tooltip::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 5px solid #333;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

/* Feedback Widget Container */
.feedback-widget-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1001;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    display: none;
    animation: slideIn 0.3s ease;
}

.feedback-widget-container.show {
    display: block;
}

.widget-header1 {
    background: #667eea;
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.widget-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.widget-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.widget-content {
    padding: 1.5rem;
}

.widget-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e2e8f0;
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
}

.widget-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

/* Feedback Overlay */
.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.feedback-overlay.show {
    display: block;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

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

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

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

.notification-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    opacity: 1;
}

/* Auth Links */
.auth-links {
    text-align: center;
    margin-top: 1rem;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
}

.auth-links a:hover {
    text-decoration: underline;
}

.home-link {
    display: block;
    margin-top: 0.5rem;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.home-link:hover {
    color: #333;
    text-decoration: underline;
}

/* Date Filter */
.date-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-content {
        padding: 1rem;
    }

    .tab-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .tab-actions {
        width: 100%;
        justify-content: flex-start;
    }

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

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

    .widgets-grid,
    .integrations-grid {
        grid-template-columns: 1fr;
    }

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

    .feedback-filters {
        flex-direction: column;
        gap: 1rem;
    }

    .feedback-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .feedback-meta {
        text-align: left;
    }

    .widget-actions,
    .integration-actions,
    .feedback-actions {
        flex-direction: column;
        width: 100%;
    }

    .widget-stats {
        flex-direction: column;
    }

    .widget-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .api-key-container {
        flex-direction: column;
        align-items: stretch;
    }

    .id-container {
        flex-direction: column;
        align-items: stretch;
    }

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

    .widget-actions {
        justify-content: stretch;
    }

    .widget-stat {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

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

    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .pagination-controls {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .api-key-container {
        flex-direction: column;
        align-items: stretch;
    }

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

    .floating-feedback {
        bottom: 1rem;
        right: 1rem;
    }

    .feedback-widget-container {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        width: auto;
    }
}

@media (max-width: 480px) {
    .login-card {
        margin: 1rem;
        padding: 1.5rem;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .dashboard-header h1,
    .tab-header h1 {
        font-size: 1.5rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        margin-bottom: 0.5rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-sm {
        width: auto;
        margin-bottom: 0;
    }
}