/**
 * Admin Styles for Maca Menu List
 */

/* Custom admin menu icon (SVG via data URI) */
#adminmenu #toplevel_page_maca-restu .wp-menu-image img {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    object-fit: contain;
    padding: 0 !important;
    margin: 0 auto !important;
    display: block;
    opacity: 0.72;
    transition: opacity 0.15s ease;
}

#adminmenu #toplevel_page_maca-restu:hover .wp-menu-image img,
#adminmenu #toplevel_page_maca-restu.current .wp-menu-image img,
#adminmenu #toplevel_page_maca-restu.wp-has-current-submenu .wp-menu-image img {
    opacity: 1;
}

/* Dashicon fallback when SVG is unavailable */
#adminmenu #toplevel_page_maca-restu .wp-menu-image.dashicons-before:before {
    font-size: 20px;
    line-height: 1.25;
}

/* Submenu section heading: Import & backup (click to expand/collapse) */
body.maca-import-group-collapsed #adminmenu #toplevel_page_maca-restu.maca-import-group-collapsed .wp-submenu li.maca-menulist-import-child,
body.maca-import-group-collapsed #adminmenu #toplevel_page_maca-restu.maca-import-group-collapsed .wp-submenu li:has(a[href*="page=maca-restu-dish-csv"]),
body.maca-import-group-collapsed #adminmenu #toplevel_page_maca-restu.maca-import-group-collapsed .wp-submenu li:has(a[href*="page=maca-menulist-import-pdf"]),
body.maca-import-group-collapsed #adminmenu #toplevel_page_maca-restu.maca-import-group-collapsed .wp-submenu li:has(a[href*="page=maca-restu-backup"]),
#adminmenu #toplevel_page_maca-restu.maca-import-group-collapsed .wp-submenu li.maca-menulist-import-child,
#adminmenu #toplevel_page_maca-restu.maca-import-group-collapsed .wp-submenu li:has(a[href*="page=maca-restu-dish-csv"]),
#adminmenu #toplevel_page_maca-restu.maca-import-group-collapsed .wp-submenu li:has(a[href*="page=maca-menulist-import-pdf"]),
#adminmenu #toplevel_page_maca-restu.maca-import-group-collapsed .wp-submenu li:has(a[href*="page=maca-restu-backup"]) {
    display: none !important;
}

#adminmenu #toplevel_page_maca-restu .wp-submenu a.maca-menulist-import-group-toggle,
#adminmenu #toplevel_page_maca-restu .wp-submenu a[href*="page=maca-restu-group-import-backup"] {
    cursor: pointer;
    background: transparent !important;
    box-shadow: none !important;
    color: #c3c4c7 !important;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 6px;
    padding-top: 10px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#adminmenu #toplevel_page_maca-restu .wp-submenu a.maca-menulist-import-group-toggle:hover,
#adminmenu #toplevel_page_maca-restu .wp-submenu a.maca-menulist-import-group-toggle:focus,
#adminmenu #toplevel_page_maca-restu .wp-submenu a[href*="page=maca-restu-group-import-backup"]:hover,
#adminmenu #toplevel_page_maca-restu .wp-submenu a[href*="page=maca-restu-group-import-backup"]:focus {
    color: #fff !important;
}

#adminmenu #toplevel_page_maca-restu .wp-submenu .maca-menulist-submenu-heading--toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#adminmenu #toplevel_page_maca-restu .wp-submenu .maca-menulist-submenu-heading--toggle::after {
    content: "\25BE";
    font-size: 14px;
    line-height: 1;
    opacity: 0.85;
    transition: transform 0.15s ease;
}

#adminmenu #toplevel_page_maca-restu.maca-import-group-collapsed .wp-submenu .maca-menulist-submenu-heading--toggle::after {
    transform: rotate(-90deg);
}

#adminmenu #toplevel_page_maca-restu .wp-submenu a[href*="page=maca-restu-dish-csv"],
#adminmenu #toplevel_page_maca-restu .wp-submenu a[href*="page=maca-menulist-import-pdf"],
#adminmenu #toplevel_page_maca-restu .wp-submenu a[href*="page=maca-restu-backup"] {
    padding-left: 20px !important;
}

#adminmenu #toplevel_page_maca-restu .wp-submenu .maca-menulist-submenu-heading {
    display: block;
}

.maca-comp-license-expiry-notice {
    border-left-color: #dba617 !important;
}

.maca-comp-license-expiry-notice .maca-comp-license-expiry-countdown {
    font-weight: 600;
}

.maca-comp-license-expiry-notice .maca-comp-license-expiry-actions {
    margin: 0.35em 0 0.15em;
}

.image-preview {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: inline-block;
}

.image-preview img {
    max-width: 300px;
    height: auto;
    display: block;
}

.status-active {
    color: #00a32a;
    font-weight: 600;
}

.status-inactive {
    color: #d63638;
    font-weight: 600;
}

.status-scheduled {
    color: #dba617;
    font-weight: 600;
}

.status-expired {
    color: #646970;
    font-weight: 600;
}

.status-outside_hours {
    color: #b26200;
    font-weight: 600;
}

.maca-menu-schedule {
    display: block;
    font-size: 13px;
    line-height: 1.4;
}

.maca-menu-schedule-links {
    margin-top: 4px;
}

.maca-menu-schedule-links a {
    font-size: 12px;
    text-decoration: none;
}

.maca-menu-schedule-links a:hover {
    text-decoration: underline;
}

.maca-menu-container {
    max-width: 100%;
}

.maca-menu-container .form-table th {
    width: 200px;
}

.maca-menu-container .regular-text {
    width: 100%;
    max-width: 400px;
}

.maca-dishes-list-filter-notice p {
    margin: 0.5em 0;
}

.maca-dishes-list-filter-clear {
    margin-left: 8px;
}

/* Drag and Drop Zone */
.maca-drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #f9f9f9;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maca-drop-zone:hover {
    border-color: #0073aa;
    background: #f0f6f8;
}

.maca-drop-zone.drag-over {
    border-color: #0073aa;
    background: #e5f5f9;
    transform: scale(1.02);
}

.maca-drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.maca-drop-zone-content .dashicons {
    font-size: 48px;
    color: #666;
    width: 48px;
    height: 48px;
}

.maca-drop-zone-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.maca-file-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border: 2px solid #0073aa;
    border-radius: 4px;
}

.maca-file-preview .dashicons {
    font-size: 32px;
    color: #0073aa;
    width: 32px;
    height: 32px;
}

.maca-file-preview span {
    font-weight: 500;
    color: #333;
}

.file-preview {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: inline-block;
}

.file-preview img {
    max-width: 300px;
    height: auto;
    display: block;
}

.file-preview a {
    color: #0073aa;
    text-decoration: none;
}

.file-preview a:hover {
    text-decoration: underline;
}

/* Guide Page Styles */
.maca-guide-content {
    max-width: 800px;
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.maca-guide-content h1 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

.maca-guide-content h2 {
    margin-top: 30px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
}

.maca-guide-content h3 {
    margin-top: 25px;
}

.maca-guide-content pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
}

.maca-guide-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

.maca-guide-content pre code {
    background: none;
    padding: 0;
}

.maca-guide-content a {
    color: #0073aa;
    text-decoration: none;
}

.maca-guide-content a:hover {
    text-decoration: underline;
}

.maca-guide-content ul,
.maca-guide-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

.maca-guide-content li {
    margin: 8px 0;
}

.maca-guide-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.maca-guide-content th,
.maca-guide-content td {
    border: 1px solid #ccd0d4;
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}

.maca-guide-content th {
    background: #f6f7f7;
}

.maca-legal-wrap .maca-legal-document {
    max-width: 52rem;
    margin: 1rem 0 1.5rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    max-height: 28rem;
    overflow: auto;
}

.maca-legal-wrap .maca-legal-document h1 {
    font-size: 1.35em;
    margin-top: 0;
}

.maca-legal-wrap .maca-legal-document h2 {
    font-size: 1.15em;
    margin-top: 1.25em;
}

.maca-legal-wrap .maca-legal-document table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
}

.maca-legal-wrap .maca-legal-document th,
.maca-legal-wrap .maca-legal-document td {
    border: 1px solid #ccd0d4;
    padding: 6px 10px;
    text-align: left;
    vertical-align: top;
}

.maca-legal-wrap .maca-legal-accept-form {
    max-width: 52rem;
    padding: 1rem 1.25rem;
    background: #f6f7f7;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
}

.maca-legal-wrap .maca-legal-accept-form label {
    font-weight: 600;
}

.maca-menulist-legal-blocked {
    padding: 1rem;
    text-align: center;
    color: #50575e;
}

.maca-orders-wrap .maca-orders-filter {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
}

.maca-orders-wrap .maca-orders-purge {
    max-width: 40rem;
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
}

.maca-orders-wrap .maca-orders-purge--staff {
    max-width: 52rem;
    border-left: 4px solid #2271b1;
    background: #f6f7f7;
}

.maca-orders-wrap .maca-orders-version {
    font-size: 12px;
    font-weight: 400;
    color: #646970;
    margin-left: 0.5rem;
}

/* Pro trial banner (no active license) */
.maca-ml-pro-trial-banner {
    margin: 10px 20px 18px 0;
    padding: 18px 22px;
    border: 1px solid #93c5fd;
    border-radius: 10px;
    background: linear-gradient(135deg, #eff6ff 0%, #ecfdf5 100%);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.maca-ml-pro-trial-banner__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
    align-items: center;
}

.maca-ml-pro-trial-banner__badge {
    flex: 0 0 auto;
    min-width: 52px;
    padding: 10px 12px;
    border-radius: 999px;
    background: #1d4ed8;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    line-height: 1;
}

.maca-ml-pro-trial-banner__content {
    flex: 1 1 280px;
    min-width: 0;
}

.maca-ml-pro-trial-banner__title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.maca-ml-pro-trial-banner__text {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
    max-width: 720px;
}

.maca-ml-pro-trial-banner__actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

@media (max-width: 782px) {
    .maca-ml-pro-trial-banner {
        margin-right: 10px;
        padding: 16px;
    }

    .maca-ml-pro-trial-banner__actions {
        width: 100%;
    }

    .maca-ml-pro-trial-banner__actions .button-hero {
        width: 100%;
        text-align: center;
    }
}

.maca-opening-hours-window-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.maca-opening-hours-windows {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 6px;
}

.maca-opening-hours-window-row input[type="time"] {
    max-width: 8.5rem;
}

.maca-opening-hours-add-window {
    margin-top: 4px;
}
