/* Basic button */
.wpstscr-sizechart-btn { display:inline-flex; justify-content: center; align-items:center; gap:8px; padding:8px 12px; background:#4A90E2; color:#fff; border:none; border-radius:8px; cursor:pointer; line-height:1.4; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.wpstscr-sizechart-btn img { width:18px; height:18px; display:block; vertical-align:middle; object-fit: contain;}
.wpstscr-sizechart-btn .wpstscr-btn-label { font-weight:600; }

/* Modal */
.wpstscr-modal-wrap { position:fixed; left:0; top:0; right:0; bottom:0; display:none; align-items:center; justify-content:center; z-index:99999; background:rgba(0,0,0,0.4); }
.wpstscr-modal-inner { background:#fff; padding:20px; border-radius:12px; max-width:920px; width:90%; max-height:80vh; overflow:auto; position:relative; }
.wpstscr-modal-body { padding:8px 0; }

/* Table */
.wpstscr-chart-table { width:100%; border-collapse:collapse; font-size:15px; }
.wpstscr-chart-table th, .wpstscr-chart-table td { border:1px solid #e6e6e6; padding:10px; text-align:center; }
.wpstscr-chart-table thead th { background:#4A90E2; color:#fff; font-weight:700; }

/* Floating widget */
/*.wpstscr-floating-widget { position:fixed; right:20px; bottom:20px; width:56px; height:56px; background:#111; color:#fff; border-radius:50%; display:flex; align-items:center; justify-content:center; z-index:99998; cursor:pointer; box-shadow:0 6px 20px rgba(0,0,0,0.2); }
.wpstscr-floating-widget img { width:22px; height:22px; display:block; }*/

/* Small responsive */
@media (max-width:720px) {
    .wpstscr-modal-inner { width:95%; padding:12px; }
    .wpstscr-sizechart-btn { padding:6px 8px; }
}

.wpstscr-btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}
.wpstscr-converted {
    background-color: #d1ffd1 !important;
    transition: background-color 0.5s ease;
}

/* ===========================
   wpstscr Modal Base Styles
=========================== */

/* Overlay */
/* =======================
   MODAL BASE STYLES
======================= */
.wpstscr-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    /*visibility: hidden;*/
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 99;
}

.wpstscr-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.wpstscr-modal-wrapper {
    position: fixed;
    z-index: 999;
    background: #fff;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    transition: all 0.4s ease;
    margin-top: 26px;
}

.wpstscr-modal-wrapper.wpstscr-modal-active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Modal Positions */
.wpstscr-position-center { top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.9); }
.wpstscr-position-top { top: 31%; left: 50%; transform: translateX(-50%) scale(0.9); }
.wpstscr-position-bottom { bottom: -30%; left: 50%; transform: translateX(-50%) scale(0.9); }
.wpstscr-position-left { top: 50%; left: 31%; transform: translateY(-50%) scale(0.9); }
.wpstscr-position-right { top: 50%; right: -32%; transform: translateY(-50%) scale(0.9); }

.wpstscr-modal-close:hover {
    transform: rotate(360deg);
}

/* =======================
   CHART LAYOUT
======================= */
.wpstscr-sizechart-output {
    display: block;
    width: 100%;
    overflow-x: auto;
}

.wpstscr-chart-table-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
}

.wpstscr-chart-table-wrap .wpstscr-chart-desc,
.wpstscr-chart-table-wrap .wpstscr-chart-image {
    flex: 1 1 250px;
    max-width: 300px;
    font-size: 15px;
}

.wpstscr-chart-table-wrap table {
    flex: 2 1 400px;
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    overflow: auto;
}

.wpstscr-chart-table th,
.wpstscr-chart-table td {
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
}

.wpstscr-chart-table th {
    background: #f7f7f7;
    font-weight: 600;
}

/* Description & Featured Positions */
.wpstscr-desc-before,
.wpstscr-desc-after,
.wpstscr-featured-before,
.wpstscr-featured-after {
    width: 100%;
    margin: 10px 0;
    font-size: 15px;
}

.wpstscr-desc-left,
.wpstscr-featured-left {
    order: -1;
}

.wpstscr-desc-right,
.wpstscr-featured-right {
    order: 2;
}

/* Image Styling */
.wpstscr-chart-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* =======================
   UNIT CONVERSION BUTTONS
======================= */
.wpstscr-unit-controls, .wpstscr-recommender-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.wpstscr-base-unit {
    background: #333;
    color: #fff;
    padding: 8px 14px;
    border-radius: 4px;
    font-weight: bold;
}

.wpstscr-convert-btn {
    background: #eee;
    color: #333;
    border: 1px solid #ccc;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.wpstscr-convert-btn:hover {
    background: #333;
    color: #fff;
}

.wpstscr-open-recommender {
  display:inline-flex;
  align-items:center;
  gap:10px;
  background: linear-gradient(180deg,#ffb953,#ff9f1a);
  border: none;
  padding:10px 14px;
  border-radius:10px;
  color:#111;
  font-weight:700;
  cursor:pointer;
  box-shadow: 0 10px 30px rgba(255,159,26,0.14);
}
.wpstscr-open-recommender:hover { transform: translateY(-2px); }

/* =======================
   RESPONSIVE BEHAVIOR
======================= */
@media (max-width: 768px) {
    .wpstscr-chart-table-wrap {
        flex-direction: column;
        align-items: center;
    }

    .wpstscr-chart-desc,
    .wpstscr-chart-image {
        order: unset;
        max-width: 100%;
        text-align: center;
    }

    .wpstscr-chart-table th,
    .wpstscr-chart-table td {
        padding: 8px;
        font-size: 14px;
    }

    .wpstscr-modal-wrapper {
        width: 95%;
        padding: 15px;
    }
}

/* =======================
   ANIMATIONS
======================= */
.wpstscr-animate-fade.wpstscr-modal-active { animation: wpstscr-fade 0.4s ease forwards; }
.wpstscr-animate-slide-up.wpstscr-modal-active { animation: wpstscr-slide-up 0.4s ease forwards; }
.wpstscr-animate-slide-down.wpstscr-modal-active { animation: wpstscr-slide-down 0.4s ease forwards; }
.wpstscr-animate-zoom-in.wpstscr-modal-active { animation: wpstscr-zoom-in 0.4s ease forwards; }
.wpstscr-animate-flip.wpstscr-modal-active { animation: wpstscr-flip 0.5s ease forwards; }
.wpstscr-animate-bounce.wpstscr-modal-active { animation: wpstscr-bounce 0.6s ease; }

@keyframes wpstscr-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes wpstscr-slide-up {
    from { transform: translate(-50%, -30%) scale(0.95); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes wpstscr-slide-down {
    from { transform: translate(-50%, -70%) scale(0.95); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes wpstscr-zoom-in {
    from { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes wpstscr-flip {
    from { transform: translate(-50%, -50%) rotateY(90deg); opacity: 0; }
    to { transform: translate(-50%, -50%) rotateY(0deg); opacity: 1; }
}
@keyframes wpstscr-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translate(-50%, -50%) translateY(0); }
    40% { transform: translate(-50%, -50%) translateY(-20px); }
    60% { transform: translate(-50%, -50%) translateY(-10px); }
}

/* Modal BG */
.wpstscr-modal-wrap {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

/* Modal Box */
.wpstscr-modal-inner {
    width: 480px;
    max-width: 95%;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(15px);
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    animation: fadeScale .25s ease;
    position: relative;
}

/* Close Btn */
.wpstscr-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: none;
    background: transparent;
    font-size: 26px;
    cursor: pointer;
}

/* Header */
.wpstscr-reco-header {
    text-align: center;
    margin-bottom: 20px;
}
.wpstscr-reco-header h2 {
    font-size: 26px;
    margin-bottom: 5px;
}

/* Form */
.wpstscr-reco-form .wpstscr-field {
    margin-bottom: 15px;
}
.wpstscr-reco-form label {
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}
.wpstscr-reco-form input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #ccc;
}

/* Submit Button */
.wpstscr-reco-submit {
    width: 100%;
    padding: 15px;
    background: #4A90E2;
    color: #fff;
    border-radius: 12px;
    font-size: 18px;
    margin-top: 10px;
    cursor: pointer;
    border: none;
    transition: .2s;
}
.wpstscr-reco-submit:hover {
    background: #357ABD;
}

/* Result Box */
#wpstscr-recommender-result {
    margin-top: 18px;
    text-align: center;
    font-size: 18px;
}
.wpstscr-reco-success {
    background: #e0ffe3;
    padding: 12px;
    border-radius: 10px;
}
.wpstscr-reco-error {
    background: #ffd9d9;
    padding: 12px;
    border-radius: 10px;
}

/* Mini Chart Preview */
.wpstscr-mini-chart-preview {
    margin-top: 25px;
    padding: 15px;
    background: #fff;
    border-radius: 12px;
}
.wpstscr-mini-chart-preview h3 {
    margin-bottom: 10px;
    text-align: center;
}

/* Animations */
@keyframes fadeScale {
    from { opacity: 0; transform: scale(.85); }
    to { opacity: 1; transform: scale(1); }
}
/*#wpstscr-recommender-modal .wpstscr-modal-inner {
    background: #fff;
    padding: 25px;
    border-radius: 14px;
    max-width: 420px;
    width: 90%;
    animation: wpstscrFadeIn .25s ease-out;
    box-shadow: 0 8px 40px rgba(0,0,0,.15);
}*/

.wpstscr-recommender-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #c2c2c2;
}

.wpstscr-recommender-sub {
    font-size: 14px;
    margin-bottom: 16px;
    color: #c2c2c2;
    font-weight: bold;
}

#wpstscr-recommender-modal .wpstscr-field {
    margin-bottom: 15px;
}

#wpstscr-recommender-modal .wpstscr-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #c2c2c2;
}

#wpstscr-recommender-modal .wpstscr-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 10px;
    transition: .2s;
}

#wpstscr-recommender-modal .wpstscr-field input:focus {
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74,144,226,.25);
}

#wpstscr-recommender-modal .wpstscr-submit-reco {
    width: 100%;
    padding: 12px 18px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 10px;
}

@keyframes wpstscrFadeIn {
    from {opacity:0; transform:scale(.95);}
    to {opacity:1; transform:scale(1);}
}
.wpstscr-reco-size.wpstscr-ai {
    background:#e1f5fe;
    border-left:4px solid #0288d1;
    padding:10px 14px;
    border-radius:6px;
    margin-bottom:10px;
    font-size:16px;
}
.wpstscr-reco-size.wpstscr-backend {
    background:#e8f5e9;
    border-left:4px solid #43a047;
    padding:10px 14px;
    border-radius:6px;
    font-size:16px;
}
