/**
 * Nexlo N8N Integration - Frontend Styles
 * Styles for the [nexlo_xero_connect] and [nexlo_xero_status] shortcodes
 */

/* ==========================================================================
   Connect Button Styles
   ========================================================================== */

.nexlo-xero-connect-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.4;
    box-sizing: border-box;
}

.nexlo-xero-connect-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nexlo-xero-connect-btn:active {
    transform: translateY(0);
}

/* Icon */
.nexlo-xero-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Button Sizes */
.nexlo-xero-btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.nexlo-xero-btn-small .nexlo-xero-icon {
    width: 16px;
    height: 16px;
}

.nexlo-xero-btn-medium {
    padding: 12px 24px;
    font-size: 15px;
}

.nexlo-xero-btn-large {
    padding: 16px 32px;
    font-size: 17px;
}

.nexlo-xero-btn-large .nexlo-xero-icon {
    width: 24px;
    height: 24px;
}

/* Button Styles - Primary (Xero Blue) */
.nexlo-xero-btn-primary {
    background: linear-gradient(135deg, #13B5EA 0%, #0A7AB8 100%);
    color: #ffffff;
    border: none;
}

.nexlo-xero-btn-primary:hover {
    background: linear-gradient(135deg, #0A9DD8 0%, #086A9E 100%);
    color: #ffffff;
}

/* Button Styles - Secondary */
.nexlo-xero-btn-secondary {
    background: #1d2327;
    color: #ffffff;
    border: none;
}

.nexlo-xero-btn-secondary:hover {
    background: #2c3338;
    color: #ffffff;
}

/* Button Styles - Outline */
.nexlo-xero-btn-outline {
    background: transparent;
    color: #13B5EA;
    border: 2px solid #13B5EA;
}

.nexlo-xero-btn-outline:hover {
    background: #13B5EA;
    color: #ffffff;
}

/* ==========================================================================
   Status Widget Styles
   ========================================================================== */

.nexlo-xero-status {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    max-width: 400px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.nexlo-xero-status-connected,
.nexlo-xero-status-disconnected {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.nexlo-xero-status-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.nexlo-xero-status-connected .nexlo-xero-status-icon {
    background: #d4edda;
    color: #155724;
}

.nexlo-xero-status-disconnected .nexlo-xero-status-icon {
    background: #f8d7da;
    color: #721c24;
}

.nexlo-xero-status-text {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

/* Tenant List */
.nexlo-xero-tenant-list {
    list-style: none;
    margin: 0 0 15px 0;
    padding: 0;
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
}

.nexlo-xero-tenant-list li {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

.nexlo-xero-tenant-list li:last-child {
    margin-bottom: 0;
}

/* Status Action */
.nexlo-xero-status-action {
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
    text-align: center;
}

/* ==========================================================================
   Error Message Styles
   ========================================================================== */

.nexlo-xero-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.nexlo-xero-error a {
    color: #533f03;
    font-weight: 600;
}

/* ==========================================================================
   Connection Result Styles
   ========================================================================== */

.nexlo-xero-result-container {
    max-width: 600px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.nexlo-xero-result {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.nexlo-xero-result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
}

.nexlo-xero-result h2 {
    margin: 0 0 15px;
    font-size: 28px;
    font-weight: 600;
    color: #1d2327;
}

.nexlo-xero-result p {
    margin: 0;
    font-size: 16px;
    color: #646970;
    line-height: 1.6;
}

/* Success State */
.nexlo-xero-result-success .nexlo-xero-result-icon {
    background: #d4edda;
    color: #155724;
}

.nexlo-xero-result-success h2 {
    color: #155724;
}

/* Error State */
.nexlo-xero-result-error .nexlo-xero-result-icon {
    background: #f8d7da;
    color: #721c24;
}

.nexlo-xero-result-error h2 {
    color: #721c24;
}

/* Info State */
.nexlo-xero-result-info .nexlo-xero-result-icon {
    background: #cce5ff;
    color: #004085;
}

.nexlo-xero-result-info h2 {
    color: #004085;
}

/* Connected Orgs List */
.nexlo-xero-connected-orgs {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e0e0e0;
    text-align: left;
}

.nexlo-xero-connected-orgs h3 {
    margin: 0 0 15px;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

.nexlo-xero-connected-orgs ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nexlo-xero-connected-orgs li {
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nexlo-xero-connected-orgs li:before {
    content: "✓";
    color: #155724;
    font-weight: bold;
}

.nexlo-xero-connected-orgs li:last-child {
    margin-bottom: 0;
}

/* Result Actions */
.nexlo-xero-result-actions {
    text-align: center;
    margin-top: 20px;
}

.nexlo-xero-back-link {
    display: inline-block;
    color: #13B5EA;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nexlo-xero-back-link:hover {
    color: #0A7AB8;
    text-decoration: underline;
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .nexlo-xero-status {
        background: #2c2c2c;
        border-color: #444;
    }
    
    .nexlo-xero-status-text {
        color: #e0e0e0;
    }
    
    .nexlo-xero-tenant-list li {
        background: #333;
        color: #e0e0e0;
    }
    
    .nexlo-xero-status-action {
        border-color: #444;
    }
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 480px) {
    .nexlo-xero-connect-btn {
        width: 100%;
    }
    
    .nexlo-xero-btn-large {
        padding: 14px 24px;
        font-size: 15px;
    }
    
    .nexlo-xero-status {
        padding: 15px;
    }
}
