/**
 * Link Modal - Link insertion with embed support
 */

.link-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.link-modal-overlay.active {
    opacity: 1;
}

.link-modal {
    background: var(--bg-primary, #fff);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 500px;
    padding: 24px;
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.link-modal-overlay.active .link-modal {
    transform: scale(1);
}

.link-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.link-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #333);
    margin: 0;
}

.link-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary, #666);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.link-modal-close:hover {
    background-color: var(--bg-hover, #f0f0f0);
}

.link-modal-body {
    margin-bottom: 20px;
}

.link-modal-input-group {
    margin-bottom: 16px;
}

.link-modal-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #333);
    margin-bottom: 8px;
}

.link-modal-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #333);
    transition: border-color 0.2s ease;
}

.link-modal-input:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
}

.link-modal-checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.link-modal-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.link-modal-checkbox-label {
    font-size: 14px;
    color: var(--text-primary, #333);
    cursor: pointer;
    user-select: none;
}

.link-modal-provider-info {
    display: none;
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary, #666);
}

.link-modal-provider-info.active {
    display: block;
}

.link-modal-provider-name {
    font-weight: 600;
    color: var(--primary-color, #007bff);
}

.link-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.link-modal-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.link-modal-btn-cancel {
    background: var(--bg-secondary, #f0f0f0);
    color: var(--text-primary, #333);
}

.link-modal-btn-cancel:hover {
    background: var(--bg-hover, #e0e0e0);
}

.link-modal-btn-submit {
    background: var(--primary-color, #007bff);
    color: white;
}

.link-modal-btn-submit:hover {
    background: var(--primary-hover, #0056b3);
}

.link-modal-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Embed block styles */
.embed-block {
    position: relative;
    margin: 16px 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary, #f8f9fa);
}

.embed-block-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.embed-block-wrapper[data-aspect="1/1"] {
    padding-bottom: 100%; /* 1:1 aspect ratio */
}

.embed-block-wrapper[data-aspect="4/3"] {
    padding-bottom: 75%; /* 4:3 aspect ratio */
}

.embed-block-wrapper[data-aspect="9/16"] {
    padding-bottom: 177.78%; /* 9:16 aspect ratio */
}

.embed-block-wrapper[data-aspect="auto"] {
    padding-bottom: 0;
    min-height: 200px;
}

.embed-block iframe,
.embed-block blockquote {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.embed-block-wrapper[data-aspect="auto"] iframe,
.embed-block-wrapper[data-aspect="auto"] blockquote {
    position: relative;
    height: auto;
    min-height: 200px;
}
