.retreathub-fb-interface {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.fb-connect-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    color: #fff;
}

.fb-connect-section h2 {
    color: #fff;
    margin-top: 0;
    font-size: 28px;
    font-weight: 600;
}

.fb-connect-section p {
    color: rgba(255,255,255,0.9);
    font-size: 16px;
    margin: 15px 0 30px;
}

.fb-connect-btn {
    background: #fff !important;
    color: #667eea !important;
    padding: 14px 32px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 8px !important;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.fb-connect-btn:hover {
    background: #f8f9fa !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.fb-connection-status {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    padding: 18px 24px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.3);
}

.connected-badge {
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.connected-badge::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    font-weight: bold;
}

.fb-section {
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
}

.fb-section:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.fb-section h2 {
    margin-top: 0;
    color: #1a1a1a;
    font-size: 24px;
    font-weight: 600;
    padding-bottom: 16px;
    margin-bottom: 24px;
    border-bottom: 3px solid #667eea;
    position: relative;
}

.fb-section h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.fb-page-selector,
.fb-form-selector {
    margin-bottom: 24px;
    padding: 20px;
    background: #f7f9fc;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
}

.fb-page-selector label,
.fb-form-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1a1a1a;
    font-size: 14px;
}

.fb-page-selector select,
.fb-form-selector select {
    width: 100%;
    max-width: 400px;
    padding: 10px 14px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    margin-right: 10px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.3s ease;
}

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

.fb-post-form .form-group {
    margin-bottom: 20px;
}

.fb-post-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.fb-post-form textarea,
.fb-post-form input[type="url"],
.fb-post-form input[type="datetime-local"],
.fb-post-form input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.fb-post-form textarea:focus,
.fb-post-form input[type="url"]:focus,
.fb-post-form input[type="datetime-local"]:focus,
.fb-post-form input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.fb-post-form textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    margin-top: 20px;
}

.button {
    padding: 11px 22px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.button-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.button-primary:active {
    transform: translateY(0);
}

.button:not(.button-primary) {
    background: #fff;
    color: #1a1a1a;
    border: 2px solid #e1e8ed;
}

.button:not(.button-primary):hover {
    background: #f7f9fc;
    border-color: #667eea;
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.fb-result {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    display: none;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

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

.fb-result.success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
    display: block;
}

.fb-result.error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
    display: block;
}

.fb-result.info {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
    display: block;
}

.fb-leads-table {
    margin-top: 24px;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.fb-leads-table table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.fb-leads-table th,
.fb-leads-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

.fb-leads-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fb-leads-table tr:hover {
    background: #f7f9fc;
}

.fb-leads-table tr:last-child td {
    border-bottom: none;
}

.fb-leads-table tbody tr {
    transition: background 0.2s ease;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.fb-cron-settings {
    background: #fff9e6;
    border: 2px solid #ffd700;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.fb-cron-settings h3 {
    margin-top: 0;
    color: #1a1a1a;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fb-cron-settings h3::before {
    content: '⚙️';
    font-size: 20px;
}

.fb-cron-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: none;
}

.fb-cron-section h2 {
    border-bottom-color: #667eea;
}

.section-description {
    color: #6c757d;
    margin: -10px 0 24px 0;
    font-size: 14px;
}

.fb-cron-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .fb-cron-grid {
        grid-template-columns: 1fr;
    }
}

.fb-cron-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.fb-cron-toggle label {
    font-weight: 500;
    cursor: pointer;
}

.fb-cron-config {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e8ed;
}

.fb-cron-interval {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.fb-cron-interval span {
    font-weight: 500;
    color: #495057;
}

.fb-cron-interval input[type="number"] {
    width: 100px;
}

.fb-cron-interval select {
    padding: 10px 14px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
}

.fb-cron-status {
    padding: 20px;
    background: #fff;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    margin-top: 24px;
    font-size: 14px;
}

.fb-cron-status .status-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.fb-cron-status .status-item:last-child {
    border-bottom: none;
}

.fb-cron-status strong {
    color: #495057;
    min-width: 120px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #28a745;
    color: #fff;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.info-badge {
    display: inline-block;
    background: #e7f3ff;
    color: #0066cc;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

@media (max-width: 768px) {
    .retreathub-fb-interface {
        padding: 10px;
    }
    
    .fb-section {
        padding: 20px 15px;
    }
    
    .fb-page-selector select,
    .fb-form-selector select {
        max-width: 100%;
        margin-bottom: 10px;
    }
    
    .fb-connection-status {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .form-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .button {
        width: 100%;
        justify-content: center;
    }
}


/* Loading spinner */
.button.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.fb-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.fb-empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.fb-empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #495057;
}

.fb-empty-state p {
    font-size: 14px;
    margin: 0;
}

/* Tooltip */
.fb-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.fb-tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #1a1a1a;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.fb-tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Card hover effect */
.fb-section {
    position: relative;
    overflow: hidden;
}

.fb-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.05), transparent);
    transition: left 0.5s;
}

.fb-section:hover::before {
    left: 100%;
}

/* Success checkmark animation */
@keyframes checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.fb-result.success::before {
    content: '✓';
    display: inline-block;
    margin-right: 8px;
    animation: checkmark 0.4s ease;
}

/* Form focus states */
.fb-post-form .form-group {
    position: relative;
}

.fb-post-form label {
    transition: color 0.3s ease;
}

.fb-post-form .form-group:focus-within label {
    color: #667eea;
}

/* Responsive grid for form actions */
.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .fb-connect-section {
        padding: 40px 20px;
    }
    
    .fb-section h2 {
        font-size: 20px;
    }
    
    .fb-cron-interval {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .fb-cron-interval input[type="number"],
    .fb-cron-interval select {
        width: 100%;
    }
}


/* Page selector section */
.fb-page-selector-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
}

.fb-page-selector-section h2 {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.3);
}

.fb-page-selector-section h2::after {
    background: #fff;
}

.fb-page-selector-section .section-description {
    color: rgba(255,255,255,0.9);
}

.fb-page-selector-section .fb-page-selector {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}

.fb-page-selector-section label {
    color: #fff;
}

.field-hint {
    font-size: 13px;
    color: #6c757d;
    margin-top: 8px;
    font-style: italic;
}
