/*
 * Filsti: assets/css/kandidat-selector.css
 * Formål: Styles til kandidat-selector frontend modul
 * Forfatter: Ukendt
 * Dato: 2024-06-10
 * Bruger filer: assets/css/common.css, assets/css/frontend.css
 * Bruges af: frontend/kandidat-selector/class-frontend-kandidat-selector.php (via wp_enqueue_style('kandidat-selector-css'))
 * Deler filer med: assets/css/common.css, assets/css/frontend.css (fælles variabler og base styles)
 * Modul: assets/css
 * Version: 1.0.0
 * Licens: Ukendt
 */

/* Kandidat Selector - modul-specifikke styles */
/* For use with .module-container.is-frontend structure */

.module-container.is-frontend #global-kandidat-select { width: 100%; max-width: 300px; margin-bottom: 1em; }
.module-container.is-frontend .global-kandidat-label { display: block; margin-bottom: .5em; }

/* Kandidat Creation Section */
.kandidat-creation-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.kandidat-creation-section p {
    margin: 0;
}

/* Kandidat Creation Only (when no selector box is shown) */
.kandidat-creation-only {
    margin: 20px 0;
}

.kandidat-creation-only p {
    margin: 0;
}

#create-kandidat-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

#create-kandidat-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Modal Styles */
.kandidat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.kandidat-modal-content {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.kandidat-modal-header {
    padding: 20px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.kandidat-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.kandidat-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.kandidat-modal-close:hover {
    color: #000;
}

.kandidat-modal-body {
    padding: 0 20px;
}

.kandidat-modal-footer {
    padding: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Form Styles within Modal */
.kandidat-modal .form-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.kandidat-modal .form-table tr {
    margin: 0;
    padding: 0;
}

.kandidat-modal .form-table th {
    width: 150px;
    text-align: left;
    padding: 15px 10px 15px 0;
    vertical-align: top;
    margin: 0;
}

.kandidat-modal .form-table td {
    padding: 15px 0;
    margin: 0;
    vertical-align: top;
}

.kandidat-modal .form-table input {
    width: 100%;
    max-width: 300px;
    min-width: 250px;
    box-sizing: border-box;
}

/* Ensure all input types have same width and styling */
.kandidat-modal .form-table input[type="text"],
.kandidat-modal .form-table input[type="tel"], 
.kandidat-modal .form-table input[type="email"],
.kandidat-modal .form-table input[type="url"],
.kandidat-modal .form-table input[type="number"] {
    width: 100%;
    max-width: 300px;
    min-width: 250px;
    height: 32px;
    padding: 4px 8px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    background-color: #fff;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Focus state for all inputs */
.kandidat-modal .form-table input[type="text"]:focus,
.kandidat-modal .form-table input[type="tel"]:focus, 
.kandidat-modal .form-table input[type="email"]:focus,
.kandidat-modal .form-table input[type="url"]:focus,
.kandidat-modal .form-table input[type="number"]:focus {
    border-color: #2271b1;
    outline: 2px solid transparent;
    box-shadow: 0 0 0 1px #2271b1;
}

/* Body class when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .kandidat-modal {
        padding: 10px;
    }
    
    .kandidat-modal-content {
        max-height: 95vh;
    }
    
    .kandidat-modal-header,
    .kandidat-modal-body,
    .kandidat-modal-footer {
        padding: 15px;
    }
    
    .kandidat-modal .form-table th {
        width: 120px;
        font-size: 14px;
    }
}

/* Toast Notifications (same as other modules) */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 350px;
}

.toast {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    padding: 12px 16px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    position: relative;
    font-size: 14px;
    line-height: 1.4;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #46b450;
    background-color: #f7fcf0;
}

.toast-success strong {
    color: #46b450;
}

.toast-error {
    border-left: 4px solid #dc3232;
    background-color: #fef7f7;
}

.toast-error strong {
    color: #dc3232;
}

.toast-info {
    border-left: 4px solid #00a0d2;
    background-color: #f0f8ff;
}

.toast-info strong {
    color: #00a0d2;
} 