/**
 * Admin CSS — Experto Dashboard for WooCommerce
 */
@import url("../../includes/experto-fonts/experto-linear-icon.css");

/* ================================================================
   VARIABLES
   ================================================================ */
:root {
   --ewc-blue:       #2271b1;
   --ewc-blue-dark:  #135e96;
   --ewc-blue-light: #e8f0f8;
   --ewc-border:     #dcdcde;
   --ewc-bg:         #f6f7f7;
   --ewc-white:      #ffffff;
   --ewc-text:       #1d2327;
   --ewc-muted:      #646970;
   --ewc-radius:     6px;
   --ewc-shadow:     0 1px 4px rgba(0,0,0,.08);
}

/* ================================================================
   PAGE HEADER
   ================================================================ */
.ewc-wrap-outer { margin-top: 8px; }

.ewc-page-header {
   background: var(--ewc-white);
   border: 1px solid var(--ewc-border);
   border-radius: var(--ewc-radius);
   margin-bottom: 20px;
   padding: 0;
   overflow: hidden;
}
.ewc-page-header-inner {
   display: flex;
   align-items: center;
   justify-content: space-between;
   padding: 16px 24px;
   background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.ewc-page-header-left {
   display: flex;
   align-items: center;
   gap: 14px;
}
.ewc-header-icon {
   width: 40px;
   height: 40px;
   object-fit: contain;
   border-radius: 8px;
   background: rgba(255,255,255,.1);
   padding: 4px;
}
.ewc-page-title {
   color: #ffffff !important;
   font-size: 20px !important;
   font-weight: 700 !important;
   margin: 0 0 2px !important;
   line-height: 1.2 !important;
   padding: 0 !important;
}

/* ================================================================
   ADMIN NOTICES
   ================================================================ */
.ewc-notices { margin-bottom: 16px; }
.ewc-notices .notice,
.ewc-notices .updated,
.ewc-notices .error {
   margin: 0 0 8px;
}
.ewc-version-badge {
   display: inline-block;
   background: rgba(255,255,255,.15);
   color: rgba(255,255,255,.8);
   font-size: 11px;
   padding: 2px 8px;
   border-radius: 20px;
   letter-spacing: .5px;
}
.ewc-page-header-right { }
.ewc-header-link {
   color: rgba(255,255,255,.75);
   font-size: 13px;
   text-decoration: none;
   transition: color .15s;
}
.ewc-header-link:hover { color: #ffffff; }

/* ================================================================
   LAYOUT: MAIN + SIDEBAR
   ================================================================ */
.ewc-layout {
   display: flex;
   gap: 20px;
   align-items: flex-start;
}
.ewc-main-col {
   flex: 1;
   min-width: 0;
}
.ewc-sidebar-col {
   width: 260px;
   flex-shrink: 0;
}

/* ================================================================
   TAB NAVIGATION
   ================================================================ */
.ewc-tab-nav {
   display: flex;
   gap: 2px;
   background: var(--ewc-white);
   border: 1px solid var(--ewc-border);
   border-radius: var(--ewc-radius);
   padding: 6px;
   margin-bottom: 16px;
}
.ewc-tab-link {
   flex: 1;
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 7px;
   padding: 9px 14px;
   border-radius: 4px;
   font-size: 13px;
   font-weight: 500;
   color: var(--ewc-muted);
   text-decoration: none;
   transition: background .15s, color .15s;
   border: none;
}
.ewc-tab-link:hover {
   background: var(--ewc-bg);
   color: var(--ewc-text);
}
.ewc-tab-link.is-active {
   background: var(--ewc-blue);
   color: #ffffff;
   box-shadow: 0 1px 3px rgba(34,113,177,.4);
}
.ewc-tab-link.is-active:hover { color: #ffffff; }
.ewc-tab-icon {
   font-size: 15px;
   line-height: 1;
}

/* ================================================================
   CARDS
   ================================================================ */
.ewc-card {
   background: var(--ewc-white);
   border: 1px solid var(--ewc-border);
   border-radius: var(--ewc-radius);
   margin-bottom: 16px;
   box-shadow: var(--ewc-shadow);
   overflow: hidden;
}
.ewc-card-header {
   padding: 18px 24px 14px;
   border-bottom: 1px solid var(--ewc-border);
   background: #fafafa;
}
.ewc-card-header h2 {
   font-size: 14px;
   font-weight: 600;
   color: var(--ewc-text);
   margin: 0 0 3px;
   line-height: 1.3;
}
.ewc-card-header p {
   margin: 0;
   font-size: 12px;
   color: var(--ewc-muted);
   line-height: 1.4;
}
.ewc-card-body {
   padding: 20px 24px;
}
.ewc-card-body--flush { padding: 0; }

/* ================================================================
   FORM FIELDS
   ================================================================ */
.ewc-field-group {
   display: flex;
   gap: 16px;
   margin-bottom: 18px;
   align-items: flex-start;
}
.ewc-field-group:last-child { margin-bottom: 0; }
.ewc-field-label {
   min-width: 120px;
   font-size: 13px;
   font-weight: 500;
   color: var(--ewc-text);
   padding-top: 7px;
   flex-shrink: 0;
}
.ewc-field-control { flex: 1; }
.ewc-field-hint {
   margin: 5px 0 0;
   font-size: 12px;
   color: var(--ewc-muted);
}
.ewc-field-control input[type="text"],
.ewc-field-control input[type="url"],
.ewc-field-control textarea,
.ewc-field-control select {
   width: 100%;
   box-sizing: border-box;
}

/* WP settings sections inside card body */
.ewc-card-body .form-table th { padding-left: 0; }
.ewc-card-body .form-table td { padding-right: 0; }

/* ================================================================
   FORM FOOTER
   ================================================================ */
.ewc-form-footer {
   display: flex;
   align-items: center;
   gap: 12px;
   padding: 16px 0 4px;
}
.ewc-form-footer--space-between { justify-content: space-between; }
.ewc-footer-right {
   display: flex;
   align-items: center;
   gap: 12px;
}
.ewc-save-message {
   font-size: 13px;
   color: #1a7341;
   font-weight: 500;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.ewc-btn {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   padding: 8px 18px;
   border-radius: 50px;
   font-size: 13px;
   font-weight: 500;
   cursor: pointer;
   border: 1px solid transparent;
   transition: background .15s, border-color .15s, color .15s;
   line-height: 1;
   text-decoration: none;
}
.ewc-btn--ghost {
   background: var(--ewc-white);
   border-color: var(--ewc-border);
   color: var(--ewc-text);
}
.ewc-btn--ghost:hover {
   background: var(--ewc-bg);
   border-color: #aaa;
}
.ewc-btn span { font-size: 17px; line-height: 1; }

/* ================================================================
   DRAG HANDLE (shared)
   ================================================================ */
.ewc-drag-handle {
   cursor: grab;
   color: #c0c2c4;
   font-size: 15px;
   padding: 4px 6px;
   flex-shrink: 0;
   user-select: none;
   transition: color .15s;
}
.ewc-drag-handle:hover { color: #888; }
.ewc-drag-handle:active { cursor: grabbing; }

/* ================================================================
   DASHBOARD PANELS
   ================================================================ */
#panel-item { margin-bottom: 4px; }

.ewc-panel {
   background: var(--ewc-white);
   border: 1px solid var(--ewc-border);
   border-radius: var(--ewc-radius);
   margin-bottom: 8px;
   box-shadow: var(--ewc-shadow);
   transition: box-shadow .15s;
}
.ewc-panel:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.ewc-panel.ui-sortable-placeholder {
   border: 2px dashed var(--ewc-border) !important;
   background: var(--ewc-bg);
   box-shadow: none !important;
   visibility: visible !important;
}

/* Panel Header */
.ewc-panel-header {
   display: flex;
   align-items: center;
   gap: 10px;
   padding: 12px 16px;
   background: #fafafa;
   border-bottom: 1px solid transparent;
   border-radius: var(--ewc-radius);
   cursor: pointer;
   transition: border-color .15s;
   user-select: none;
}
.ewc-panel.active > .ewc-panel-header {
   border-bottom-color: var(--ewc-border);
   border-radius: var(--ewc-radius) var(--ewc-radius) 0 0;
}
.ewc-panel-header h4 {
   flex: 1;
   margin: 0;
   font-size: 13px;
   font-weight: 500;
   color: var(--ewc-text);
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}
.ewc-panel-header::after {
   content: "";
   width: 0; height: 0;
   border-left: 5px solid transparent;
   border-right: 5px solid transparent;
   border-top: 5px solid #aaa;
   flex-shrink: 0;
   transition: transform .2s;
}
.ewc-panel.active > .ewc-panel-header::after { transform: rotate(180deg); }

/* Panel action buttons */
.ewc-panel-actions {
   display: flex;
   gap: 6px;
   flex-shrink: 0;
}
.ewc-panel-actions button {
   display: flex;
   align-items: center;
   justify-content: center;
   width: 28px;
   height: 28px;
   background: #efefef;
   border: 1px solid #ddd;
   border-radius: 50%;
   cursor: pointer;
   font-size: 13px;
   color: #555;
   padding: 0;
   transition: background .15s, color .15s;
}
.ewc-panel-actions button:hover { background: #e0e0e0; }
.ewc-remove-panel:hover { background: #fde8e8 !important; color: #c0392b !important; border-color: #f5c6cb !important; }

/* Panel Body */
.ewc-panel-body {
   padding: 18px 20px;
   display: none;
}
.ewc-panel.active > .ewc-panel-body { display: block; }

/* ================================================================
   ICON FIELD
   ================================================================ */
.icon-field {
   display: flex;
   align-items: center;
   gap: 10px;
   cursor: pointer;
}
.icons-display {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   width: 38px;
   height: 38px;
   border-radius: 50%;
   border: 1px solid var(--ewc-border);
   background: var(--ewc-white);
   cursor: pointer;
   flex-shrink: 0;
   font-size: 16px;
   transition: border-color .15s;
}
.icons-display:hover { border-color: var(--ewc-blue); }
.ewc-icon-hint { font-size: 12px; color: var(--ewc-muted); }

/* ================================================================
   ICON PICKER OVERLAY
   ================================================================ */
.icon-wrap-overlay {
   position: fixed;
   inset: 0;
   background: rgba(0,0,0,.5);
   z-index: 99999;
   display: flex;
   align-items: center;
   justify-content: center;
}
.icon-wrap {
   width: 580px;
   max-width: 90vw;
   max-height: 65vh;
   background: var(--ewc-white);
   border-radius: 8px;
   overflow-y: auto;
   padding: 16px;
   display: flex;
   flex-wrap: wrap;
   gap: 4px;
   box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.icon-wrap .icon {
   width: 44px;
   height: 44px;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   border: 1px solid #f0f0f0;
   border-radius: 6px;
   cursor: pointer;
   font-size: 18px;
   color: #444;
   transition: background .1s, border-color .1s, color .1s;
}
.icon-wrap .icon:hover {
   background: var(--ewc-blue-light);
   border-color: var(--ewc-blue);
   color: var(--ewc-blue);
}

/* ================================================================
   NAVIGATION ITEMS LIST
   ================================================================ */
#ewc-nav-items-list {
   list-style: none;
   margin: 0;
   padding: 0;
}
.ewc-nav-item {
   display: flex;
   align-items: center;
   gap: 10px;
   padding: 12px 20px;
   border-bottom: 1px solid var(--ewc-border);
   background: var(--ewc-white);
   transition: background .1s;
}
.ewc-nav-item:last-child { border-bottom: none; }
.ewc-nav-item:hover { background: #fafafa; }
.ewc-nav-item.ui-sortable-helper {
   box-shadow: 0 4px 16px rgba(0,0,0,.12);
   border-radius: var(--ewc-radius);
   border: 1px solid var(--ewc-blue);
}
.ewc-nav-item.ui-sortable-placeholder {
   visibility: visible !important;
   background: var(--ewc-blue-light);
   border: 2px dashed var(--ewc-blue);
   border-left: none;
   border-right: none;
   height: 48px;
}
.ewc-nav-item-label {
   flex: 1;
   font-size: 13px;
   font-weight: 500;
   color: var(--ewc-text);
}
.ewc-nav-item-custom { background: #fafcff; }

/* Custom nav item fields */
.ewc-nav-item-fields {
   display: flex;
   align-items: center;
   gap: 8px;
   flex: 1;
   flex-wrap: wrap;
}
.ewc-nav-item-fields input[type="text"],
.ewc-nav-item-fields input[type="url"] {
   border: 1px solid var(--ewc-border);
   border-radius: 4px;
   padding: 5px 9px;
   font-size: 12px;
   width: 140px;
   box-sizing: border-box;
   transition: border-color .15s;
}
.ewc-nav-item-fields input:focus { border-color: var(--ewc-blue); outline: none; }

.ewc-nav-icon-wrap { display: flex; align-items: center; }
.ewc-nav-icon-trigger { width: 32px; height: 32px; font-size: 14px; cursor: pointer; }

.ewc-remove-nav-item {
   background: none;
   border: 1px solid transparent;
   color: #bbb;
   cursor: pointer;
   font-size: 15px;
   padding: 3px 7px;
   border-radius: 4px;
   flex-shrink: 0;
   transition: color .15s, background .15s, border-color .15s;
}
.ewc-remove-nav-item:hover {
   color: #c0392b;
   background: #fde8e8;
   border-color: #f5c6cb;
}

.ewc-nav-items-footer {
   padding: 14px 20px;
   border-top: 1px solid var(--ewc-border);
   background: #fafafa;
}

/* ================================================================
   TOGGLE SWITCH
   ================================================================ */
.ewc-toggle {
   position: relative;
   display: inline-block;
   width: 42px;
   height: 24px;
   flex-shrink: 0;
   cursor: pointer;
}
.ewc-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.ewc-toggle-slider {
   position: absolute;
   inset: 0;
   background: #ccc;
   border-radius: 24px;
   transition: background .2s;
}
.ewc-toggle-slider::before {
   content: "";
   position: absolute;
   width: 18px;
   height: 18px;
   left: 3px;
   top: 3px;
   background: var(--ewc-white);
   border-radius: 50%;
   transition: transform .2s;
   box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.ewc-toggle input:checked + .ewc-toggle-slider { background: var(--ewc-blue); }
.ewc-toggle input:checked + .ewc-toggle-slider::before { transform: translateX(18px); }

/* ================================================================
   SIDEBAR
   ================================================================ */
.ewc-sidebar-card {
   background: var(--ewc-white);
   border: 1px solid var(--ewc-border);
   border-radius: var(--ewc-radius);
   margin-bottom: 16px;
   overflow: hidden;
   box-shadow: var(--ewc-shadow);
}
.ewc-sidebar-card-header {
   padding: 14px 18px;
   border-bottom: 1px solid var(--ewc-border);
   background: #fafafa;
}
.ewc-sidebar-card-header h3 {
   margin: 0;
   font-size: 13px;
   font-weight: 600;
   color: var(--ewc-text);
}
.ewc-sidebar-links { padding: 8px 0; }
.ewc-sidebar-link {
   display: flex;
   align-items: center;
   gap: 10px;
   padding: 9px 18px;
   font-size: 13px;
   color: var(--ewc-muted);
   text-decoration: none;
   transition: background .1s, color .1s;
}
.ewc-sidebar-link:hover {
   background: var(--ewc-blue-light);
   color: var(--ewc-blue);
}
.ewc-sidebar-link span { font-size: 14px; }

.ewc-sidebar-ads { padding: 8px; }
.ewc-sidebar-ads a { display: block; margin-bottom: 6px; }
.ewc-sidebar-ads a:last-child { margin-bottom: 0; }
.ewc-ad-img { width: 100%; border-radius: 4px; display: block; }

/* ================================================================
   MENU ICON
   ================================================================ */
#toplevel_page_ewc .wp-menu-image img {
   width: 100%;
   padding: 5px;
   box-sizing: border-box;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media screen and (max-width: 960px) {
   .ewc-layout { flex-direction: column; }
   .ewc-sidebar-col { width: 100%; }
}
@media screen and (max-width: 600px) {
   .ewc-tab-nav { flex-direction: column; }
   .ewc-field-group { flex-direction: column; gap: 6px; }
   .ewc-field-label { min-width: auto; padding-top: 0; }
}
