/**
 * Accepta Copyright Control CSS
 * Styles for the visual copyright control with dynamic tags
 */

.accepta-copyright-control {
    margin-bottom: 12px;
}

.accepta-copyright-editor {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    padding: 12px;
    margin-top: 8px;
}

/* Tags Section */
.accepta-copyright-tags {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.accepta-copyright-tags-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.accepta-copyright-tags-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.accepta-copyright-tag-btn {
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    color: #0073aa;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.accepta-copyright-tag-btn:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
}

.accepta-copyright-tag-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 115, 170, 0.3);
}

/* Input Section */
.accepta-copyright-input-wrapper {
    margin-bottom: 12px;
}

.accepta-copyright-textarea {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    line-height: 1.4;
    resize: vertical;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s ease;
}

.accepta-copyright-textarea:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
    outline: none;
}

.accepta-copyright-textarea::placeholder {
    color: #999;
    font-style: italic;
}

.accepta-copyright-textarea.tag-inserted {
    border-color: #46b450;
    box-shadow: 0 0 0 2px rgba(70, 180, 80, 0.2);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Preview Section */
.accepta-copyright-preview {
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.accepta-copyright-preview-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.accepta-copyright-preview-content {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
    padding: 8px;
    font-size: 12px;
    line-height: 1.4;
    color: #333;
    min-height: 20px;
}

.accepta-copyright-preview-content:empty::before {
    content: attr(data-placeholder);
    color: #999;
    font-style: italic;
}

.accepta-copyright-preview-content a {
    color: #0073aa;
    text-decoration: none;
}

.accepta-copyright-preview-content a:hover {
    text-decoration: underline;
}

/* Tag insertion animation */
@keyframes tagInserted {
    0% { background: rgba(0, 115, 170, 0.1); }
    100% { background: transparent; }
}

.accepta-copyright-textarea.tag-inserted {
    animation: tagInserted 0.5s ease;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .accepta-copyright-tags-buttons {
        gap: 4px;
    }
    
    .accepta-copyright-tag-btn {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* Focus states for accessibility */
.accepta-copyright-tag-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.accepta-copyright-textarea:focus {
    outline: none;
}

/* Loading state */
.accepta-copyright-control.loading .accepta-copyright-preview-content {
    opacity: 0.6;
    position: relative;
}

.accepta-copyright-control.loading .accepta-copyright-preview-content::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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