/* 광고 모달 스타일 */
.ad-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.ad-modal-content {
    position: relative;
    max-width: 600px;
    width: 90%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    animation: adModalSlideIn 0.3s ease;
}

@keyframes adModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.7);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
}

.ad-badge {
    background: #FF9500;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.ad-skip-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    min-width: 120px;
}

.ad-skip-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ad-skip-btn:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.35);
}

.ad-media {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: #111;
}

.ad-media img,
.ad-media video {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.ad-click-hint {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    pointer-events: none;
}

/* 광고 정보 (제목/설명) */
.ad-info {
    padding: 16px;
    background: #111;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.ad-description {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

/* =====================================================
   Ad Edit Modal - 광고 수정 공용 모달 스타일
   ===================================================== */

.ad-edit-modal-shared {
    position: fixed;
    inset: 0;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-edit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.ad-edit-content {
    position: relative;
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: adEditSlideIn 0.25s ease;
}

@keyframes adEditSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.ad-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.ad-edit-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.ad-edit-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.ad-edit-close:hover {
    background: #eee;
}

.ad-edit-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ad-edit-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ad-edit-field label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.ad-edit-field label .required {
    color: #ff6b6b;
}

.ad-edit-field input,
.ad-edit-field select,
.ad-edit-field textarea {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
    background: #fff;
    color: #000;
}

.ad-edit-field input:focus,
.ad-edit-field select:focus,
.ad-edit-field textarea:focus {
    outline: none;
    border-color: #4A90E2;
}

.ad-edit-field textarea {
    resize: none;
}

.ad-edit-field small {
    font-size: 12px;
    color: #888;
}

.ad-edit-row {
    display: flex;
    gap: 12px;
}

.ad-edit-field.half {
    flex: 1;
}

/* 키워드 */
.ad-edit-keywords-container {
    min-height: 40px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ad-edit-placeholder {
    color: #999;
    font-size: 12px;
}

.ad-edit-keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #4A90E2;
    color: #fff;
    border-radius: 14px;
    font-size: 12px;
}

.ad-edit-keyword-tag .remove {
    cursor: pointer;
    font-weight: bold;
    margin-left: 2px;
}

.ad-edit-keyword-tag .remove:hover {
    color: #ffcdd2;
}

.ad-edit-keyword-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.ad-edit-keyword-btn {
    padding: 5px 10px;
    background: #e8e8e8;
    border-radius: 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.ad-edit-keyword-btn:hover {
    background: #d0d0d0;
}

.ad-edit-keyword-btn.active {
    background: #4A90E2;
    color: #fff;
}

/* Footer */
.ad-edit-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.ad-edit-btn-cancel,
.ad-edit-btn-save {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.ad-edit-btn-cancel {
    background: #f0f0f0;
    color: #333;
}

.ad-edit-btn-cancel:hover {
    background: #e0e0e0;
}

.ad-edit-btn-save {
    background: #4CAF50;
    color: #fff;
}

.ad-edit-btn-save:hover {
    background: #43A047;
}

/* Responsive */
@media (max-width: 480px) {
    .ad-edit-content {
        width: 95%;
        max-height: 95vh;
    }

    .ad-edit-row {
        flex-direction: column;
        gap: 16px;
    }

    .ad-edit-field.half {
        width: 100%;
    }
}
