@import "./common.css";

.customer-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.status-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.status-card.success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.status-card.warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.status-card.info {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

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

.user-info {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.user-info h3 {
    margin-top: 0;
    color: #495057;
}

.pubkey {
    font-family: monospace;
    background: #f8f9fa;
    padding: 5px 8px;
    border-radius: 4px;
    word-break: break-all;
    font-size: 0.9em;
}

.action-buttons {
    margin: 20px 0;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    margin: 5px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    border: 1px solid #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

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

.btn-secondary:hover {
    background-color: #545b62;
    border-color: #545b62;
}

.customer-details {
    background: #ffffff;
    border: 1px solid #28a745;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
}

.customer-details h3 {
    color: #28a745;
    margin-top: 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #495057;
}

.detail-value {
    color: #6c757d;
}

.nip85-panel {
    background: #ffffff;
    border: 1px solid #007bff;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
}

.nip85-panel h3 {
    color: #007bff;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nip85-status {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 600;
}

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

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

.event-details {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
}

.event-id {
    font-family: monospace;
    background: #e9ecef;
    padding: 5px 8px;
    border-radius: 4px;
    word-break: break-all;
    font-size: 0.85em;
}

.timestamp {
    color: #6c757d;
    font-size: 0.9em;
}

.tags-list {
    max-height: 200px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
}

.tag-item {
    font-family: monospace;
    font-size: 0.8em;
    padding: 2px 0;
    border-bottom: 1px solid #f8f9fa;
}

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

.nip85-loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.event-status-section {
    border-top: 1px solid #dee2e6;
    margin-top: 20px;
    padding-top: 20px;
}

.event-status-section h4 {
    color: #007bff;
    margin-bottom: 15px;
}

.info-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: #495057;
}

.info-value {
    color: #007bff;
    font-weight: 500;
}

.event-json {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    font-size: 0.85em;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.event-management {
    border-top: 1px solid #dee2e6;
    margin-top: 20px;
    padding-top: 20px;
}

.event-management h4 {
    color: #007bff;
    margin-bottom: 15px;
}

.button-group {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.event-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.event-btn.primary {
    background: #007bff;
    color: white;
}

.event-btn.primary:hover:not(:disabled) {
    background: #0056b3;
}

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

.event-btn.secondary:hover:not(:disabled) {
    background: #545b62;
}

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

.event-preview {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
    display: none;
}

.event-preview h5 {
    margin-top: 0;
    color: #495057;
}

.event-preview pre {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    font-size: 0.85em;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.status-message {
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-weight: 500;
}

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

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

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

.auth-link {
    color: #007bff;
    text-decoration: underline;
}

/* New NIP-85 Status Panel Styles */
.nip85-status-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 15px 0;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #dee2e6;
}

.status-item.mismatch-details {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.status-label {
    font-weight: 600;
    color: #495057;
    flex: 1;
    margin-right: 15px;
}

.status-value {
    text-align: right;
    font-weight: 500;
    flex: 1;
}

.status-value.success {
    color: #28a745;
}

.status-value.warning {
    color: #ffc107;
}

.status-value.error {
    color: #dc3545;
}

.status-value.info {
    color: #17a2b8;
}

.status-value small {
    display: block;
    font-size: 0.8em;
    color: #6c757d;
    margin-top: 4px;
    font-family: 'Courier New', monospace;
}

.nip85-details {
    margin: 15px 0;
}

.raw-event-container {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.raw-event-container h5 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #495057;
}

.raw-event-container pre {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    font-size: 0.85em;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.nip85-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    color: #6c757d;
}

.nip85-loading .loader {
    width: 30px;
    height: 30px;
    margin-bottom: 15px;
}

@media (min-width: 768px) {
    .nip85-status-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Toggle Button Styles (matching manage-customer.html) */
.raw-note-section {
    margin-top: 15px;
}

.raw-note-header {
    margin-bottom: 10px;
}

.toggle-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #495057;
    transition: all 0.2s ease;
    width: auto;
}

.toggle-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.toggle-btn.expanded {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.toggle-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.toggle-btn.expanded .toggle-icon {
    transform: rotate(180deg);
}

.raw-note-content {
    margin-top: 10px;
}

.raw-note-data {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    font-size: 0.85em;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
    margin: 0;
    font-family: 'Courier New', monospace;
}
