/* General Styles */

/* Reset Page Styles */
.gatelink-reset-page .gatelink-reset-header {
    background: #E91919;
    color: white;
    padding: 20px;
    margin: 0 -20px 20px -20px;
    border-radius: 6px;
}

.gatelink-reset-page .gatelink-reset-header h1 {
    color: white;
    margin: 0 0 8px 0;
    font-size: 24px;
}

.gatelink-reset-page .gatelink-reset-warning {
    color: #fff3cd;
    margin: 0;
    font-weight: 500;
}

.gatelink-reset-sections {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.gatelink-reset-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    border-left: 4px solid #E91919;
}

.gatelink-reset-section h2 {
    color: #E91919;
    margin-top: 0;
    margin-bottom: 10px;
}

.gatelink-reset-section .description {
    margin-bottom: 15px;
    color: #666;
}

.gatelink-reset-button {
    background: #E91919 !important;
    border-color: #E91919 !important;
    color: white !important;
    font-weight: 500;
    padding: 8px 16px !important;
}

.gatelink-reset-button:hover {
    background: #d41717 !important;
    border-color: #c31515 !important;
}

.gatelink-reset-button.gatelink-reset-dangerous {
    background: #a01313 !important;
    border-color: #a01313 !important;
}

.gatelink-reset-button.gatelink-reset-dangerous:hover {
    background: #8b1111 !important;
    border-color: #8b1111 !important;
}

/* Nav Tab Reset Highlight */
.nav-tab-wrapper .nav-tab-reset.nav-tab-active {
    background-color: #E91919 !important;
    border-color: #E91919 !important;
    color: white !important;
}

.nav-tab-wrapper .nav-tab-reset:hover {
    color: #E91919 !important;
}

/* Plan Badge */
.gatelink-plan-badge {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.gatelink-plan-info {
    font-weight: 500;
    color: #495057;
}

.gatelink-plan-badge .button {
    font-size: 12px;
    height: auto;
    padding: 4px 12px;
}

/* Disabled forms */
form[style*="opacity"] input,
form[style*="opacity"] button {
    cursor: not-allowed;
}

.gatelink-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gatelink-modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    position: relative;
}

.gatelink-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.gatelink-modal-body h3 {
    margin-top: 0;
    font-size: 1.2em;
}

/* Toast Notifications */
.gatelink-toast {
    position: fixed;
    top: 32px;
    right: 20px;
    z-index: 100001;
    padding: 12px 16px;
    border-radius: 6px;
    color: #fff;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: gatelink-toast-slide-in 0.3s ease-out;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.gatelink-toast.success {
    background-color: #059669;
    border-left: 4px solid #047857;
}

.gatelink-toast.error {
    background-color: #dc2626;
    border-left: 4px solid #b91c1c;
}

.gatelink-toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

@keyframes gatelink-toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Actions Row */
.gatelink-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* State Indicators */
.gatelink-check-badge {
    color: #059669;
    font-weight: bold;
    margin-left: 4px;
}

.gatelink-action-connect.gatelink-connected {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

.gatelink-action-verify.gatelink-verified {
    background-color: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
}

/* Loading States */
.gatelink-loading {
    position: relative;
}

.gatelink-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: rgba(255,255,255,0.8);
    animation: gatelink-spin 0.8s linear infinite;
}

.gatelink-loading .button-text {
    opacity: 0;
}

@keyframes gatelink-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive Layout */
@media (max-width: 1200px) {
    .gatelink-actions-row {
        gap: 4px;
    }
    
    .gatelink-actions-row .button {
        font-size: 11px;
        padding: 3px 8px;
    }
}

@media (max-width: 900px) {
    .gatelink-actions-row {
        gap: 4px;
    }
    
    .gatelink-actions-row .button {
        font-size: 10px;
        padding: 2px 6px;
        margin-bottom: 2px;
    }
}

/* Health Check Modal */
.gatelink-health-status {
    font-weight: bold;
    padding: 5px;
    border-radius: 3px;
    margin-bottom: 10px;
}
.gatelink-health-status.success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}
.gatelink-health-status.error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}
.gatelink-response-body {
    background-color: #f1f1f1;
    border: 1px solid #ddd;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Help/Troubleshooting Box */
.gatelink-help-box {
    margin-top: 15px;
    padding: 15px;
    background-color: #fff8e1;
    border: 1px solid #ffecb3;
    border-radius: 4px;
}
.gatelink-help-box h4 {
    margin-top: 0;
    color: #6d4c41;
}
.gatelink-help-box code {
    background-color: #f5f5f5;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: monospace;
}

/* Troubleshooting Modal */
.gatelink-modal-content h3 {
    color: #d63384;
    margin-top: 0;
}

.gatelink-modal-content ol, 
.gatelink-modal-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.gatelink-modal-content li {
    margin: 5px 0;
    line-height: 1.5;
}

.gatelink-help-box ul li {
    margin: 8px 0;
}

.gatelink-help-box strong {
    color: #8b4513;
}

/* Domain Test Results */
.gatelink-test-result {
    margin-top: 10px;
}

.gatelink-test-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 10px;
    color: #155724;
}

.gatelink-test-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 10px;
    color: #721c24;
}

.gatelink-test-success h4,
.gatelink-test-error h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
}

.gatelink-test-success ul,
.gatelink-test-error ul {
    margin: 5px 0;
    padding-left: 20px;
}

.gatelink-test-success li,
.gatelink-test-error li {
    margin: 3px 0;
    font-size: 13px;
}

.gatelink-test-domain {
    margin-left: 5px;
}

/* Error Message */
.gatelink-error-message {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Status indicators */
.gatelink-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: capitalize;
}
.gatelink-status-verified {
    background-color: #dcfce7;
    color: #166534;
}
.gatelink-status-connected {
    background-color: #dbeafe;
    color: #1e40af;
}
.gatelink-status-pending {
    background-color: #fef9c3;
    color: #854d0e;
}
.gatelink-status-error {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Add/Edit Forms */
#gatelink-add-site-box, #gatelink-manual-pairing-box {
    background: #fff;
    border: 1px solid #c3c4c7;
    padding: 20px;
    margin-top: 20px;
}
#gatelink-manual-pairing-box {
    display: none;
}
.nav-tab-wrapper {
    margin-bottom: 0;
}

/* Dashboard Cards */
.gatelink-dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.gatelink-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.gatelink-card h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gatelink-card-value {
    font-size: 28px;
    font-weight: bold;
    color: #1d2327;
}

.gatelink-card-success {
    color: #00a32a;
}

.gatelink-card-warning {
    color: #dba617;
}

.gatelink-card-info {
    color: #3858e9;
    font-size: 14px;
    font-weight: normal;
}

/* Version Footer */
.gatelink-version-footer {
    margin-top: 15px;
    text-align: right;
    color: #777;
}

/* Uninstall Page Styles */
.gatelink-uninstall-page {
    max-width: 800px;
}

.gatelink-uninstall-page h3 {
    margin-top: 0;
    color: #1d2327;
}

.gatelink-uninstall-details {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.gatelink-uninstall-details h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #1d2327;
}

.gatelink-deletion-list {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.gatelink-deletion-list li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.gatelink-deletion-list li:before {
    content: "🗑️";
    position: absolute;
    left: 0;
}

.gatelink-uninstall-details .notice {
    margin: 15px 0 0 0;
}

/* Clear Logs Form */
.gatelink-clear-logs-form {
    margin-bottom: 20px;
}

/* Log Table Headers */
.gatelink-log-timestamp {
    width: 150px;
}

.gatelink-log-level-header {
    width: 80px;
}

.gatelink-log-context {
    width: 200px;
}

.gatelink-log-context-details {
    margin-top: 5px;
    font-size: 11px;
    max-height: 100px;
    overflow-y: auto;
}

/* Log Levels */
.gatelink-log-level {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.gatelink-log-info {
    background-color: #e6f3ff;
    color: #0073aa;
}

.gatelink-log-error {
    background-color: #ffe6e6;
    color: #dc3232;
}

.gatelink-log-warning {
    background-color: #fff8e1;
    color: #f56e28;
}

/* License Page Styles */
.gatelink-license-info {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.gatelink-license-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 500;
    background-color: #e6f3ff;
    color: #0073aa;
}

.gatelink-license-actions {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
}

.gatelink-license-reset {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.gatelink-license-reset .description {
    color: #666;
    font-style: italic;
    margin-bottom: 10px;
}
