/* DILA Banner Styles */
.dila-banner {
    background: #e7f5fe;
    border-left: 4px solid #2271b1;
    padding: 15px 20px;
    margin: 0 0 15px 0;
    border-radius: 3px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    position: sticky;
    top: 32px; /* WordPress admin bar height */
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dila-banner-show {
    opacity: 1;
    transform: translateY(0);
}

.dila-banner-warning {
    background: #fcf3cd;
    border-left-color: #dba617;
}

.dila-banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    padding-right: 35px; /* Space for dismiss button */
}

.dila-banner-message {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0; /* Allow text to shrink */
}

.dila-banner-content .dashicons {
    color: #2271b1;
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.dila-banner-warning .dashicons {
    color: #dba617;
}

.dila-banner-content strong {
    font-weight: 600;
}

.dila-banner-text {
    flex: 1;
    min-width: 0; /* Allow text to shrink */
}

.dila-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.dila-banner-dismiss {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 15px;
    right: 15px;
    flex-shrink: 0;
}

.dila-banner-dismiss:hover {
    color: #d63638;
}

.dila-insert-link-btn {
    margin: 0 !important;
}

/* Classic Editor - sticky banner before postdivrich */
.dila-banner + #postdivrich {
    /* Banner is positioned before #postdivrich */
}

/* Make banner sticky in Classic Editor context */
#post-body .dila-banner {
    position: sticky;
    top: 32px;
    z-index: 999999; /* Higher than TinyMCE toolbar z-index */
}

/* Highlighted text in editor */
.dila-highlight {
    background: #ffeb3b;
    padding: 2px 4px;
    border-radius: 2px;
    animation: dila-pulse 2s ease-in-out 3;
}

@keyframes dila-pulse {
    0%, 100% {
        background: #ffeb3b;
    }
    50% {
        background: #fdd835;
    }
}

/* Link instruction banner */
.dila-link-instruction-banner {
    background: #d7f0ff;
    border-left: 4px solid #0073aa;
    padding: 12px 16px;
    margin: 0 0 15px 0;
    border-radius: 3px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    position: sticky;
    top: 120px; /* Below the main banner */
    z-index: 99;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dila-link-instruction-banner.show {
    opacity: 1;
    transform: translateY(0);
}

.dila-instruction-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.dila-instruction-content .dashicons {
    color: #0073aa;
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.dila-instruction-content kbd {
    display: inline-block;
    padding: 3px 6px;
    background: #fff;
    border: 1px solid #0073aa;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
    font-weight: 600;
    color: #0073aa;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.dila-instruction-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
}

.dila-instruction-close:hover {
    color: #d63638;
}

/* Notification styles (legacy - keeping for backward compatibility) */
.dila-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #1e1e1e;
    color: #fff;
    padding: 16px 24px;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    z-index: 999999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    max-width: 400px;
    font-size: 14px;
    line-height: 1.5;
}

.dila-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 782px) {
    .dila-banner {
        top: 46px; /* Mobile admin bar height */
    }

    #post-body .dila-banner {
        top: 46px; /* Classic Editor on mobile */
    }

    .dila-link-instruction-banner {
        top: 140px; /* Adjusted for mobile */
    }

    .dila-banner-content {
        flex-wrap: wrap;
    }

    .dila-banner-message {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .dila-banner-actions {
        width: 100%;
    }

    .dila-banner-actions .button {
        width: 100%;
    }

    .dila-notification {
        left: 20px;
        right: 20px;
        bottom: 20px;
        max-width: none;
    }
}

/* When admin bar is hidden or user scrolled past it */
@media screen and (max-width: 600px) {
    .dila-banner {
        top: 0;
    }

    #post-body .dila-banner {
        top: 0; /* Classic Editor on small mobile */
    }

    .dila-link-instruction-banner {
        top: 90px;
    }
}
