/* Improved editor styles - Modern & Stylish */
.edit-link {
    display: inline-block;
    width: 100%;
    padding: 8px 16px;
    background-color: #4a6cf7;
    color: white;
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 19px;
    font-weight: 500;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(50, 50, 93, 0.11);
}

.edit-link:hover {
    background-color: #3a56e4;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(50, 50, 93, 0.1);
}

.edit-link:active {
    transform: translateY(1px);
}

/* リストページ用の編集ボタンスタイル */
.list-edit-button-container {
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
    position: relative;
    z-index: 10;
}

.list-edit-link {
    display: inline-block;
    padding: 3px 8px;
    background-color: #4a6cf7;
    color: white !important;
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(50, 50, 93, 0.11);
    text-decoration: none !important;
    position: relative;
    z-index: 100;
}

.list-edit-link:hover {
    background-color: #3a56e4;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(50, 50, 93, 0.1);
    color: white !important;
}

.list-edit-link:active {
    transform: translateY(1px);
}

#edit-popup {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: #ffffff;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#edit-popup form {
    display: flex;
    flex-direction: column;
}

#edit-popup .form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

#edit-popup .form-header h2 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.close-popup {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.close-popup:hover {
    color: #333;
    background-color: #f5f8ff;
}

#edit-popup label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    display: block;
    font-size: 14px;
}

#edit-popup input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-top: 3px;
    font-size: 14px;
    transition: border-color 0.3s;
}

#edit-popup input[type="text"]:focus {
    border-color: #4a6cf7;
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.2);
}

#edit-popup .form-group {
    margin-bottom: 12px;
}

#edit-popup .two-column {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 8px;
}

#edit-popup .two-column .form-group,
#edit-popup .column {
    flex: 1 0 45%;
}

.taxonomy-options {
    margin-top: 5px;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px;
    background-color: #ffffff;
    font-size: 12px;
}

.taxonomy-option {
    margin-bottom: 6px;
}

.taxonomy-option label {
    display: flex;
    align-items: center;
    font-weight: normal;
    margin-bottom: 2px;
    cursor: pointer;
    padding: 3px 0;
    transition: background-color 0.2s;
}

.taxonomy-option label:hover {
    background-color: #f5f8ff;
}

.taxonomy-option input[type="checkbox"] {
    margin-right: 6px;
    cursor: pointer;
}

.submit-button {
    background-color: #4a6cf7;
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(50, 50, 93, 0.11);
    align-self: flex-end;
}

.submit-button:hover {
    background-color: #3a56e4;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(50, 50, 93, 0.1);
}

.submit-button:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading animation */
.loading-spinner {
    display: none;
    text-align: center;
    padding: 10px 0;
}

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid #4a6cf7;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success message */
.success-message {
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    margin-top: 10px;
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
    font-size: 13px;
}

/* Scrollbar styling */
.taxonomy-options::-webkit-scrollbar {
    width: 6px;
}

.taxonomy-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.taxonomy-options::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.taxonomy-options::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* タクソノミーグループのスタイル */
.taxonomy-group {
    margin-bottom: 12px;
}

.taxonomy-group h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #333;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 3px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #edit-popup .two-column {
        flex-direction: column;
        gap: 10px;
    }
    
    #edit-popup {
        width: 90%;
        padding: 15px;
        max-height: 80vh;
    }
    
    .submit-button {
        width: 100%;
    }
}