/* Internal Link Scanner Frontend Styles */
.ils-scanner-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 25px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
}

.ils-scanner-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 26px;
    font-weight: 600;
    text-align: center;
}

.ils-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    align-items: stretch;
}

.ils-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #ffffff;
}

.ils-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.ils-input::placeholder {
    color: #95a5a6;
}

.ils-scan-button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.ils-scan-button:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.ils-scan-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Progress Styles */
.ils-progress {
    text-align: center;
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.ils-progress-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
}

.ils-progress-bar::after {
    content: '';
    display: block;
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 3px;
    animation: progress-slide 2s infinite ease-in-out;
}

@keyframes progress-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.ils-progress-text {
    color: #5a6c7d;
    font-size: 16px;
    font-weight: 500;
}

/* Results Styles */
.ils-results {
    margin-top: 30px;
    padding: 25px;
    background: #ffffff;
    border-radius: 12px;
    border: 2px solid #3498db;
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.1);
}

.ils-results-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.ils-results-header h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 22px;
    font-weight: 600;
}

.ils-results-header p {
    margin: 5px 0;
    color: #5a6c7d;
}

.ils-results-header a {
    color: #3498db;
    text-decoration: none;
    word-break: break-all;
}

.ils-results-header a:hover {
    text-decoration: underline;
}

/* No Results Styles */
.ils-no-results {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #bdc3c7;
}

.ils-no-results p {
    margin: 10px 0;
    color: #5a6c7d;
}

.ils-debug-info {
    margin-top: 20px;
    padding: 15px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.ils-debug-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

.ils-debug-info li {
    margin: 5px 0;
    color: #5a6c7d;
}

/* Suggestion Styles */
.ils-suggestion {
    margin-bottom: 25px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-left: 5px solid #3498db;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.ils-suggestion:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.ils-suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.ils-suggestion-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 18px;
    flex: 1;
    min-width: 200px;
}

.ils-confidence {
    background: #27ae60;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.ils-confidence-high {
    background: #27ae60;
}

.ils-confidence-medium {
    background: #f39c12;
}

.ils-confidence-low {
    background: #e74c3c;
}

.ils-suggestion-details {
    margin-bottom: 15px;
}

.ils-suggestion-details p {
    margin: 8px 0;
    color: #5a6c7d;
    line-height: 1.5;
}

.ils-anchor-text {
    background: #fff3cd;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #856404;
    font-size: 14px;
}

.ils-author {
    color: #6c757d;
    font-style: italic;
}

.ils-target-link {
    color: #3498db;
    text-decoration: none;
    word-break: break-all;
}

.ils-target-link:hover {
    text-decoration: underline;
}

.ils-paragraph-preview {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    font-style: italic;
    color: #5a6c7d;
    border-left: 3px solid #dee2e6;
    line-height: 1.6;
}

.ils-suggestion-actions {
    margin-top: 15px;
    text-align: right;
}

.ils-copy-link {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ils-copy-link:hover {
    background: #218838;
    transform: translateY(-1px);
}

.ils-copy-link:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Scan Summary */
.ils-scan-summary {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.ils-scan-summary h5 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
}

.ils-scan-summary ul {
    margin: 0;
    padding-left: 20px;
}

.ils-scan-summary li {
    margin: 8px 0;
    color: #5a6c7d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ils-scanner-container {
        margin: 10px;
        padding: 20px;
    }
    
    .ils-input-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .ils-scan-button {
        width: 100%;
    }
    
    .ils-suggestion-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ils-suggestion-title {
        min-width: auto;
        margin-bottom: 10px;
    }
    
    .ils-confidence {
        align-self: flex-start;
    }
    
    .ils-results {
        padding: 20px;
    }
    
    .ils-scanner-form h3 {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .ils-scanner-container {
        margin: 5px;
        padding: 15px;
    }
    
    .ils-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .ils-suggestion {
        padding: 15px;
    }
    
    .ils-results {
        padding: 15px;
    }
}

/* Loading Animation */
.ils-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error States */
.ils-success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
    margin: 15px 0;
}

.ils-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    margin: 15px 0;
}