/**
 * Admin-specific styles for Course Flow plugin.
 * Version: 1.0.1
 * Author: Pawel Borowiec
 * Text Domain: course-flow
 *
 * This file contains all admin styles for Course Flow, including the
 * PRO submenu highlight rules scoped to body.courseflow-pro-highlight.
 * The "fallback" rules increase visual prominence of the PRO submenu
 * when JavaScript DOM reordering is unavailable.
 */

/* Prevent horizontal scrolling in the admin panel */
#wpcontent .wrap {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Language container with grid layout for up to 3 columns */
#wpcontent #courseflow_language_container {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(12.5rem, 15.625rem)) !important;
    gap: 0.625rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
}

/* Language option styling */
#wpcontent #courseflow_language_container .courseflow-language-option {
    display: flex !important;
    align-items: center !important;
    padding: 0.5rem !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    background-color: #fff !important;
    transition: background-color 0.2s !important;
}

/* Language option hover effect */
#wpcontent #courseflow_language_container .courseflow-language-option:hover {
    background-color: #f0f0f0 !important;
}

/* Radio input styling in language option */
#wpcontent #courseflow_language_container .courseflow-language-option input[type="radio"] {
    margin: 0 0.625rem 0 0 !important;
    vertical-align: middle !important;
}

/* Language flag image styling */
#wpcontent #courseflow_language_container .courseflow-language-option img.courseflow-language-flag {
    width: 1.25rem !important;
    height: 1.25rem !important;
    object-fit: contain !important;
    margin-right: 0.625rem !important;
}

/* Bold text for selected language */
#wpcontent #courseflow_language_container .courseflow-language-option input[type="radio"]:checked + img + span {
    font-weight: bold !important;
}

/* Tablets (max-width: 1024px) - Two columns */
@media screen and (max-width: 64rem) {
    #wpcontent #courseflow_language_container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Smartphones (max-width: 400px) - One column */
@media screen and (max-width: 25rem) {
    #wpcontent #courseflow_language_container {
        grid-template-columns: 1fr !important;
    }
}

/* Copy button styles for ALL admin pages */
.courseflow-copy-button {
    margin-left: 10px;
    padding: 8px !important;
    font-size: 12px;
    cursor: pointer;
    background: #f1f1f1 !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    box-sizing: border-box !important;
}

.courseflow-copy-button:hover {
    background: #e5e5e5 !important;
}

.courseflow-copy-button:active {
    background: #d0d0d0 !important;
    transform: translateY(1px);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1) !important;
}

.courseflow-copy-button img {
    width: 16px !important;
    height: 16px !important;
    vertical-align: middle;
}

/* Copy notification toast styles - WITHOUT overlay */
.courseflow-copy-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #28a745;
    color: #fff;
    padding: 0.9375rem 1.875rem;
    border-radius: 8px;
    z-index: 99999;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 1rem;
    text-align: center;
    display: none;
    font-weight: 600;
}

/* -----------------------------
 * PRO Submenu highlight styles
 * Scoped to body.courseflow-pro-highlight to avoid global admin interference.
 * ----------------------------- */

/* Base state: ensure readable contrast for the PRO submenu link. */
body.courseflow-pro-highlight #adminmenu .wp-submenu a[href*="page=courseflow-pro-upgrade"],
body.courseflow-pro-highlight #adminmenu .wp-has-current-submenu .wp-submenu a[href*="page=courseflow-pro-upgrade"],
body.courseflow-pro-highlight #adminmenu .opensub .wp-submenu li.current a[href*="page=courseflow-pro-upgrade"] {
    background-color: rgba(255, 215, 0, 0.15) !important;
    border-left: 4px solid #f0c000 !important;
    color: #f0c000 !important;
    font-weight: 600;
    padding-left: 8px !important;
    box-shadow: 0 1px 0 rgba(34, 113, 177, 0.08) !important;
    border-radius: 2px !important;
}

/* Current/hover/focus states ensure slightly darker background for clarity. */
body.courseflow-pro-highlight #adminmenu .wp-submenu li.current a[href*="page=courseflow-pro-upgrade"],
body.courseflow-pro-highlight #adminmenu .wp-submenu li.current a[href*="page=courseflow-pro-upgrade"]:focus,
body.courseflow-pro-highlight #adminmenu .wp-submenu li.current a[href*="page=courseflow-pro-upgrade"]:hover {
    background-color: rgba(255, 215, 0, 0.15) !important;
    border-left: 4px solid #f0c000 !important;
    color: #f0c000 !important;
    font-weight: 600;
    padding-left: 8px !important;
}

/* Hover/focus for non-current states. */
body.courseflow-pro-highlight #adminmenu .wp-submenu a[href*="page=courseflow-pro-upgrade"]:hover,
body.courseflow-pro-highlight #adminmenu .wp-submenu a[href*="page=courseflow-pro-upgrade"]:focus {
    background-color: rgba(255, 215, 0, 0.25) !important;
    color: #d4a000 !important;
}

/* -----------------------------
 * CSS fallback to improve visibility when JS DOM reorder is unavailable.
 *
 * - This boost is scoped to body.courseflow-pro-highlight so it only applies
 *   when server-side logic requests PRO highlight.
 * - It does NOT change DOM order; it only increases visual prominence.
 * - This provides graceful degradation when JS is blocked or fails.
 * ----------------------------- */

/* Slightly larger font and a soft glow to stand out in the list. */
body.courseflow-pro-highlight #adminmenu .wp-submenu a[href*="page=courseflow-pro-upgrade"] {
    font-size: 14px !important;
    line-height: 1.35 !important;
}

/* Add a subtle left "stripe" that visually distinguishes the item even if it's lower in the list. */
body.courseflow-pro-highlight #adminmenu .wp-submenu a[href*="page=courseflow-pro-upgrade"] {
    position: relative !important;
    margin-left: -4px !important;
    padding-left: 16px !important;
}

/* Add focus outline for accessibility when keyboard-navigating. */
body.courseflow-pro-highlight #adminmenu .wp-submenu a[href*="page=courseflow-pro-upgrade"]:focus {
    outline: 3px solid rgba(34,113,177,0.12) !important;
    outline-offset: 2px !important;
}

/* Ensure the fallback does not negatively affect small screens. */
@media (max-width: 640px) {
    body.courseflow-pro-highlight #adminmenu .wp-submenu a[href*="page=courseflow-pro-upgrade"] {
        font-size: 13px !important;
        padding-left: 12px !important;
    }
}

/* Other admin styles remain above. */
