/**
 * Organization Links Modal CSS
 * Colors:
 * - Primary Blue: #0055a5
 * - Secondary Orange: #ff7f00
 * - Text: #333333
 */

/* Add Button */
.org-links-add-button-container {
    margin-bottom: 20px;
    text-align: right;
}

.org-links-add-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #0055a5;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.org-links-add-button:hover {
    background-color: #004080;
    box-shadow: 0 2px 8px rgba(0, 85, 165, 0.3);
}

.org-links-add-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 85, 165, 0.3);
}

.org-links-add-button svg {
    width: 18px;
    height: 18px;
}

/* Modal Backdrop */
.org-links-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.org-links-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.org-links-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.org-links-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Content */
.org-links-modal-content {
    background-color: white;
    border-radius: 8px;
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.org-links-modal.active .org-links-modal-content {
    transform: scale(1);
}

/* Modal Header */
.org-links-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background-color: #0055a5;
    color: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.org-links-modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    padding: 0;
    color: white;
}

.org-links-modal-close {
    background: transparent;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.org-links-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.org-links-modal-close:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.org-links-modal-close svg {
    width: 20px;
    height: 20px;
}

/* Modal Body */
.org-links-modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 70px - 70px);
}

/* Form Groups */
.org-links-form-group {
    margin-bottom: 20px;
}

.org-links-form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.org-links-form-group input[type="text"],
.org-links-form-group input[type="url"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
    transition: all 0.2s ease;
}

.org-links-form-group input[type="text"]:focus,
.org-links-form-group input[type="url"]:focus {
    border-color: #0055a5;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 85, 165, 0.2);
}

.required {
    color: #e53935;
    margin-left: 2px;
}

/* Logo Upload */
.org-links-logo-upload {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.org-links-logo-preview {
    width: 100%;
    height: 120px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
    overflow: hidden;
    transition: all 0.2s ease;
}

.org-links-logo-preview:hover {
    border-color: #0055a5;
}

.org-links-logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 10px;
}

.org-links-logo-actions {
    display: flex;
    gap: 10px;
}

.org-links-logo-select {
    flex: 1;
    background-color: #0055a5;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.org-links-logo-select:hover {
    background-color: #004080;
}

.org-links-logo-remove {
    background-color: #e53935;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
}

.org-links-logo-remove:hover {
    background-color: #c62828;
}

.org-links-logo-hint {
    margin: 5px 0 0 0;
    font-size: 13px;
    color: #777;
}

/* Radio Group */
.org-links-radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.org-links-radio {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.org-links-radio:hover {
    background-color: #f5f5f5;
}

.org-links-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.org-links-radio-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #999;
    position: relative;
    margin-right: 10px;
    transition: all 0.2s ease;
}

.org-links-radio-icon.internal {
    border-color: #0055a5;
}

.org-links-radio-icon.external {
    border-color: #ff7f00;
}

.org-links-radio input[type="radio"]:checked + .org-links-radio-icon:after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.org-links-radio input[type="radio"]:checked + .org-links-radio-icon.internal:after {
    background-color: #0055a5;
}

.org-links-radio input[type="radio"]:checked + .org-links-radio-icon.external:after {
    background-color: #ff7f00;
}

.org-links-radio-label {
    font-size: 15px;
    font-weight: 400;
}

/* Modal Footer */
.org-links-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

.org-links-modal-cancel {
    background-color: transparent;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.org-links-modal-cancel:hover {
    background-color: #f5f5f5;
}

.org-links-modal-submit {
    background-color: #0055a5;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.org-links-modal-submit:hover {
    background-color: #004080;
}

.org-links-modal-submit:disabled {
    background-color: #999;
    cursor: not-allowed;
}

/* Notification */
.org-links-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    padding: 15px 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.org-links-notification.active {
    transform: translateY(0);
    opacity: 1;
}

.org-links-notification.success {
    background-color: #4caf50;
    color: white;
}

.org-links-notification.error {
    background-color: #f44336;
    color: white;
}

.org-links-notification-close {
    background: transparent;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    cursor: pointer;
    margin-left: 10px;
}

/* Prevent body scroll when modal is open */
body.org-links-modal-open {
    overflow: hidden;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .org-links-modal-content {
        width: 90%;
    }
    
    .org-links-radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .org-links-modal-footer {
        flex-direction: column-reverse;
    }
    
    .org-links-modal-cancel,
    .org-links-modal-submit {
        width: 100%;
    }
    
    .org-links-notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: calc(100% - 20px);
        max-width: none;
        min-width: 0;
    }
}

/* WordPress Admin Fixes */
.wp-admin .org-links-modal {
    z-index: 100000;
}

.wp-admin .org-links-modal-backdrop {
    z-index: 99999;
}

.wp-admin .org-links-notification {
    z-index: 100001;
}