/**
 * Smart Affiliate Link Manager - Admin Styles
 * Stili per l'interfaccia amministrativa del plugin
 */

/* Container principale */
.sal-admin-wrap {
    margin-top: 20px;
}

.sal-admin-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.sal-main-section {
    flex: 1;
    min-width: 0;
}

.sal-sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* Card styling */
.sal-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    margin-bottom: 20px;
    padding: 20px;
}

.sal-card h2,
.sal-card h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.sal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sal-card-header h2 {
    margin: 0;
    border: none;
    padding: 0;
}

/* Form styling */
.sal-form .form-table th {
    width: 200px;
    padding: 15px 10px 15px 0;
}

.sal-form .form-table td {
    padding: 15px 10px;
}

.sal-form .required {
    color: #d63638;
}

.sal-form .description {
    color: #646970;
    font-size: 13px;
    margin-top: 5px;
}

/* Tabella keyword */
.sal-keywords-table {
    margin-top: 15px;
}

.sal-keywords-table th {
    font-weight: 600;
}

.sal-keywords-table td {
    vertical-align: middle;
}

.sal-meta {
    color: #646970;
    font-size: 12px;
}

.sal-link-preview {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: #2271b1;
}

.sal-link-preview:hover {
    color: #135e96;
}

.sal-link-preview .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Badge e status */
.sal-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 5px;
}

.sal-badge-info {
    background: #e5f5fa;
    color: #007cba;
}

.sal-badge-warning {
    background: #fcf3cf;
    color: #9e6a03;
}

.sal-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.sal-status-active {
    background: #d5f4e6;
    color: #00a32a;
}

.sal-status-inactive {
    background: #f0f0f1;
    color: #646970;
}

/* Azioni */
.sal-actions {
    white-space: nowrap;
}

.sal-actions .button {
    margin-right: 5px;
}

/* Form di modifica inline */
.sal-edit-form {
    padding: 15px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    margin-top: 10px;
}

.sal-edit-field {
    margin-bottom: 12px;
}

.sal-edit-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.sal-edit-field input[type="text"],
.sal-edit-field input[type="url"],
.sal-edit-field input[type="number"] {
    width: 100%;
    max-width: 400px;
}

.sal-edit-actions {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #dcdcde;
}

/* Empty state */
.sal-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #646970;
}

.sal-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    opacity: 0.3;
}

.sal-empty-state p {
    margin-top: 15px;
    font-size: 14px;
}

/* Istruzioni */
.sal-instructions {
    padding-left: 20px;
    margin: 10px 0;
}

.sal-instructions li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Statistiche */
.sal-stats {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.sal-stat-item {
    flex: 1;
    text-align: center;
    padding: 15px;
    background: #f6f7f7;
    border-radius: 4px;
}

.sal-stat-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #2271b1;
    line-height: 1;
}

.sal-stat-label {
    display: block;
    font-size: 12px;
    color: #646970;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Log attività */
.sal-logs {
    list-style: none;
    margin: 10px 0 0 0;
    padding: 0;
}

.sal-log-item {
    padding: 12px;
    border-bottom: 1px solid #f0f0f1;
    font-size: 13px;
}

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

.sal-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.sal-log-type {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: #f0f0f1;
    color: #646970;
}

.sal-log-type-keyword_added,
.sal-log-type-keyword_updated {
    background: #e5f5fa;
    color: #007cba;
}

.sal-log-type-keyword_deleted {
    background: #fcf0f1;
    color: #d63638;
}

.sal-log-type-content_processed {
    background: #d5f4e6;
    color: #00a32a;
}

.sal-log-date {
    font-size: 11px;
    color: #8c8f94;
}

.sal-log-message {
    color: #2c3338;
}

.sal-log-count {
    color: #646970;
    font-size: 12px;
}

.sal-no-logs {
    text-align: center;
    color: #8c8f94;
    font-size: 13px;
    padding: 20px 0;
}

/* Security info */
.sal-security-info {
    background: #f0f6fc;
    border-color: #c3e0f5;
}

.sal-security-features {
    list-style: none;
    margin: 10px 0 0 0;
    padding: 0;
}

.sal-security-features li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.sal-security-features .dashicons {
    color: #00a32a;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Responsive */
@media screen and (max-width: 1280px) {
    .sal-admin-container {
        flex-direction: column;
    }

    .sal-sidebar {
        width: 100%;
    }
}

@media screen and (max-width: 782px) {
    .sal-keywords-table {
        font-size: 13px;
    }

    .sal-actions .button {
        display: block;
        width: 100%;
        margin: 3px 0;
    }

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

/* Loading spinner */
.sal-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: sal-spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

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

/* Notice personalizzati */
.sal-notice {
    padding: 12px;
    margin: 15px 0;
    border-left: 4px solid;
    background: #fff;
}

.sal-notice-success {
    border-left-color: #00a32a;
    background: #f0f6fc;
}

.sal-notice-error {
    border-left-color: #d63638;
    background: #fcf0f1;
}

.sal-notice-warning {
    border-left-color: #dba617;
    background: #fcf9e8;
}

/* ================
   TAB NAVIGATION
   =============== */
.nav-tab-wrapper {
    margin: 20px 0;
    border-bottom: 1px solid #ccc;
}

.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    font-size: 14px;
}

.nav-tab .dashicons {
    font-size: 18px;
    margin-top: 2px;
}

.sal-tab-content {
    margin-top: 20px;
}

.sal-tab-content.sal-tab-active {
    display: block !important;
}

/* =====================
   SUPPORT TAB STYLING
   ==================== */
.sal-support-card {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 40px !important;
    border: none !important;
}

.sal-support-card h2 {
    color: #fff;
    font-size: 28px;
    margin-top: 15px;
}

.sal-support-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sal-support-buttons {
    margin: 30px 0;
}

.sal-paypal-btn {
    background: #ffc439 !important;
    border-color: #ffc439 !important;
    color: #111 !important;
    font-size: 18px !important;
    padding: 15px 40px !important;
    height: auto !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s;
}

.sal-paypal-btn:hover {
    background: #ffb700 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.sal-testimonial {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 20px;
}

/* Contact List */
.sal-contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sal-contact-list li {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.sal-contact-list li:last-child {
    border-bottom: none;
}

.sal-contact-list .dashicons {
    color: #0073aa;
    margin-top: 3px;
}

.sal-contact-list a {
    color: #0073aa;
    text-decoration: none;
}

.sal-contact-list a:hover {
    text-decoration: underline;
}

/* Services List */
.sal-services-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sal-services-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.sal-services-list li:last-child {
    border-bottom: none;
}

/* Reviews Card */
.sal-reviews-card {
    background: #fffbf0;
    border-left: 4px solid #ffc107;
}

.sal-reviews-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sal-reviews-card .dashicons-star-filled {
    color: #ffc107;
}

/* Form Response Messages */
#sal-form-response {
    padding: 15px;
    border-radius: 4px;
    font-weight: 500;
}

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

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