/*
 * Filsti: assets/css/tone-voice-selector.css
 * Formål: CSS styles for tone and voice selector frontend modul
 * Forfatter: AI Assistant
 * Dato: 2024-12-19
 * Bruger filer: frontend/tone-voice-selector/class-frontend-tone-voice-selector.php
 * Bruges af: Tone and voice selector frontend modul
 * Modul: assets/css
 * Version: 1.0.0
 * Licens: Ukendt
 */

/* ===== TONE VOICE SELECTOR STYLES ===== */

/* Grid layout for tone voice cards */
.tone-voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Individual tone voice card */
.tone-voice-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

.tone-voice-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Card states */
.tone-voice-card.assigned {
    border-left: 4px solid var(--success);
    background: var(--primary-lighter);
}

.tone-voice-card.unassigned {
    border-left: 4px solid var(--border);
    background: var(--bg-primary);
}

/* Egne tone of voice kort - svagt mørkere baggrund */
.tone-voice-card.own-tone {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
}

.tone-voice-card.own-tone:hover {
    background: #f1f3f4;
    border-color: #ced4da;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Card header */
.tone-voice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.tone-voice-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}



/* Card content */
.tone-voice-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.tone-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
    font-style: italic;
    min-height: 40px;
}

.tone-status {
    margin-bottom: 8px;
    font-size: 14px;
}

.tone-status strong {
    color: var(--text-primary);
}

.status-assigned {
    color: var(--success);
    font-weight: 600;
}

.status-unassigned {
    color: var(--warning);
    font-weight: 600;
}

.visibility-info {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid var(--info);
    margin-bottom: 8px;
}

/* Card actions */
.tone-voice-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: auto;
}

.tone-voice-actions .button {
    flex: 1;
    min-width: 120px;
    text-align: center;
    font-size: 13px;
    padding: 8px 12px;
}

/* Button states for different actions */
.grant-tone-access {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.grant-tone-access:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.remove-tone-access {
    background: var(--bg-primary);
    border-color: var(--error);
    color: var(--error);
}

.remove-tone-access:hover {
    background: var(--error);
    color: white;
}

.view-tone-details {
    background: var(--bg-primary);
    border-color: var(--border);
    color: var(--text-secondary);
}

.view-tone-details:hover {
    background: var(--hover-bg);
    border-color: var(--primary);
    color: var(--primary);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--bg-primary);
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.close {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    position: absolute;
    top: 15px;
    right: 20px;
}

.close:hover,
.close:focus {
    color: var(--text-primary);
}

/* Modal content styling */
#tone-details-content h3 {
    color: var(--primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}

#tone-details-content .tone-meta {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

#tone-details-content .tone-meta strong {
    color: var(--text-primary);
    display: inline-block;
    min-width: 120px;
}

/* Header actions */
.header-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.header-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    padding: 10px 16px;
}

.header-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Large modal for editing */
.large-modal {
    max-width: 800px;
}

/* Form styling */
.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-row input[type="text"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-row input[type="text"]:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.form-row textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* Checkbox styling */
.form-row input[type="checkbox"] {
    margin-right: 8px;
}

.form-row input[type="checkbox"] + small {
    display: inline;
    margin-left: 5px;
}

/* Kandidat selection */
.kandidat-checkboxes {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 15px;
    background: var(--bg-secondary);
}

.checkbox-item {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-item:hover {
    color: var(--primary);
}

.checkbox-item input[type="checkbox"] {
    margin-right: 10px;
}

.no-kandidater {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 4px;
    border: 1px dashed var(--border);
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.form-actions .button {
    min-width: 120px;
}

/* Edit button styling */
.edit-tone-voice {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.edit-tone-voice .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Copy button styling */
.copy-tone-voice {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-primary);
    border-color: #0073aa;
    color: #0073aa;
}

.copy-tone-voice:hover {
    background: #0073aa;
    color: white;
    border-color: #005a87;
}

.copy-tone-voice .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Delete button styling */
.delete-tone-voice {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-primary);
    border-color: var(--error);
    color: var(--error);
}

.delete-tone-voice:hover {
    background: var(--error);
    color: white;
    border-color: #a00;
}

.delete-tone-voice .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Responsive design */
@media (max-width: 768px) {
    .tone-voice-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tone-voice-card {
        padding: 15px;
        min-height: 200px;
    }
    
    .tone-voice-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    

    
    .tone-voice-actions {
        flex-direction: column;
    }
    
    .tone-voice-actions .button {
        width: 100%;
        min-width: auto;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .button {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .tone-voice-card {
        padding: 12px;
        min-height: 180px;
    }
    
    .tone-voice-header h3 {
        font-size: 16px;
    }
    

}

/* Loading states */
.tone-voice-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.tone-voice-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/error message styling */
.tone-voice-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.tone-voice-message.success {
    background: var(--primary-lighter);
    border: 1px solid var(--success);
    color: var(--success);
}

.tone-voice-message.error {
    background: #fef2f2;
    border: 1px solid var(--error);
    color: var(--error);
}

/* Empty state styling */
.tone-voice-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.tone-voice-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.tone-voice-empty h3 {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.tone-voice-empty p {
    margin: 0;
    line-height: 1.6;
}

/* Toast notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    pointer-events: none;
}

.toast {
    background: #d4edda;
    color: #155724;
    padding: 12px 16px;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 14px;
    font-weight: 500;
    max-width: 350px;
    pointer-events: auto;
    animation: toastSlideIn 0.4s ease-out;
    position: relative;
    cursor: pointer;
}

.toast.toast-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.toast.toast-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.toast.toast-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

@keyframes toastSlideIn {
    0% {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
}

/* Spin animation for loading states */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}
