/*=========================================================
RoyAI v5 - Complete Clean Stylesheet
Desktop + 991px Mobile/Tablet Responsive Breakdown
=========================================================*/

:root {
    --rw-primary: #008181;
    --rw-primary-hover: #006666;
    --rw-nc-red: #d9381e;
    --rw-nc-teal: #14b8a6;
    --rw-dark: #0f172a;
    --rw-muted: #64748b;
    --rw-border: #e2e8f0;
    --rw-bg: #f8fafc;
    --rw-card: #ffffff;
    --rw-radius: 8px;
    --rw-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

*, *::before, *::after { 
    box-sizing: border-box; 
}

body { 
    margin: 0; 
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    background: var(--rw-bg); 
    color: var(--rw-dark); 
}

button, input, select { 
    font: inherit; 
}

/*=========================================================
LAYOUT CONTAINER
=========================================================*/
.rw-app { 
    width: 100%; 
    padding: 32px 16px; 
}

.rw-container { 
    width: 100%; 
    max-width: 800px; 
    margin: 0 auto; 
}

/*=========================================================
HERO SECTION
=========================================================*/
.rw-hero { 
    text-align: center; 
    margin-bottom: 24px; 
}

#rw-title { 
    margin: 0 0 6px; 
    font-size: 26px; 
    font-weight: 700;
    color: var(--rw-primary); 
}

#rw-subtitle { 
    margin: 0; 
    font-size: 14px; 
    color: var(--rw-muted); 
}

/*=========================================================
WIDGET CARD & TABS
=========================================================*/
.rw-card { 
    background: var(--rw-card); 
    border: 1px solid var(--rw-border); 
    border-radius: var(--rw-radius); 
    padding: 20px; 
    box-shadow: var(--rw-shadow); 
}

.rw-switcher { 
    display: flex; 
    gap: 8px; 
    margin-bottom: 16px; 
    background: #f1f5f9; 
    padding: 4px; 
    border-radius: var(--rw-radius); 
}

.rw-tab { 
    flex: 1; 
    height: 40px; 
    border: none; 
    border-radius: 6px; 
    background: transparent; 
    color: var(--rw-muted); 
    font-weight: 600; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    transition: all 0.2s ease;
}

.rw-tab.active { 
    background: #fff; 
    color: var(--rw-primary); 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
}

/*=========================================================
FORMS, INPUTS & QUICK PILLS
=========================================================*/
#rw-search-form, #rw-generator-form { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}

.rw-label { 
    font-size: 13px; 
    font-weight: 600; 
    color: var(--rw-dark); 
    margin-bottom: -4px; 
}

.rw-label small { 
    font-size: 11px; 
    color: var(--rw-muted); 
    font-weight: 400; 
}

.rw-input-group { 
    position: relative; 
    width: 100%; 
}

.rw-input-group i { 
    position: absolute; 
    left: 14px; 
    top: 50%; 
    transform: translateY(-50%); 
    color: var(--rw-muted); 
}

.rw-input, .rw-select, #rw-domain { 
    width: 100%; 
    height: 44px; 
    padding: 0 14px 0 40px; 
    border: 1px solid var(--rw-border); 
    border-radius: var(--rw-radius); 
    background: #fff;
    outline: none; 
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.rw-input { 
    padding-left: 14px; 
}

.rw-input:focus, .rw-select:focus, #rw-domain:focus { 
    border-color: var(--rw-primary); 
}

.rw-quick-pills {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.rw-pill {
    background: #f1f5f9;
    color: #64748b;
    font-size: 11.5px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.rw-pill strong {
    color: var(--rw-primary);
    font-weight: 700;
}

/*=========================================================
BUTTONS
=========================================================*/
.rw-btn { 
    height: 44px; 
    border-radius: var(--rw-radius); 
    border: none; 
    font-size: 14px;
    font-weight: 600; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    width: 100%; 
    transition: background-color 0.2s ease;
}

.rw-btn-primary { 
    background: var(--rw-primary); 
    color: #fff; 
}

.rw-btn-primary:hover { 
    background: var(--rw-primary-hover); 
}

.rw-btn-secondary { 
    background: #fff; 
    border: 1px solid var(--rw-border); 
    color: var(--rw-dark); 
}

/*=========================================================
RESULTS HEADER & ACTION BUTTONS
=========================================================*/
.rw-results { 
    margin-top: 20px; 
}

.rw-results-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 12px; 
    padding-bottom: 8px; 
    border-bottom: 1px solid var(--rw-border); 
}

.rw-results-title { 
    margin: 0; 
    font-size: 16px; 
    font-weight: 700; 
    color: var(--rw-dark); 
}

.rw-action-group { 
    display: flex; 
    gap: 8px; 
}

.rw-action-btn { 
    background: #fff; 
    border: 1px solid var(--rw-border); 
    color: var(--rw-primary); 
    font-size: 12px; 
    font-weight: 600; 
    padding: 6px 12px; 
    border-radius: 6px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    transition: all 0.2s ease; 
}

.rw-action-btn:hover { 
    border-color: var(--rw-primary); 
    background: #f0fdfa; 
}

.rw-action-btn.rw-btn-outline { 
    color: var(--rw-muted); 
}

/*=========================================================
NAMECHEAP RESULT CARDS (DESKTOP DEFAULT)
=========================================================*/
.rw-results-list { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}

.rw-nc-card { 
    background: #fff; 
    border: 1px solid var(--rw-border); 
    border-radius: var(--rw-radius); 
    padding: 16px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.rw-nc-left { 
    flex: 1; 
    min-width: 0; 
}

.rw-nc-domain-row { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.rw-nc-check-icon { 
    color: var(--rw-nc-teal); 
    font-size: 18px; 
}

.rw-nc-check-icon.taken { 
    color: var(--rw-nc-red); 
}

.rw-domain-name { 
    margin: 0; 
    font-size: 18px; 
    font-weight: 700; 
    word-break: break-all;
}

.rw-score-badge {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.rw-score-badge strong {
    color: var(--rw-primary);
    font-weight: 700;
}

.rw-registered-badge { 
    background: #fee2e2; 
    color: #991b1b; 
    font-size: 10px; 
    font-weight: 700; 
    padding: 2px 6px; 
    border-radius: 4px; 
    text-transform: uppercase; 
}

.rw-promo-badge { 
    background: #ccfbf1; 
    color: #0f766e; 
    font-size: 11px; 
    font-weight: 700; 
    padding: 2px 8px; 
    border-radius: 99px; 
}

.rw-fav-star {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 15px;
    padding: 0 4px;
    transition: color 0.2s ease;
}

.rw-fav-star:hover,
.rw-star-active {
    color: #eab308 !important;
}

.rw-whois-info {
    color: var(--rw-primary);
    cursor: pointer;
    font-size: 13px;
    margin-left: 2px;
}

.rw-summary { 
    margin: 4px 0 0; 
    font-size: 13px; 
    color: var(--rw-muted); 
    line-height: 1.5;
}

.rw-nc-right { 
    display: flex; 
    align-items: center; 
    gap: 16px; 
}

.rw-pricing-block { 
    text-align: right; 
}

.rw-price-main { 
    font-size: 18px; 
    font-weight: 700; 
    color: var(--rw-dark); 
}

.rw-price-main small {
    font-size: 12px;
    font-weight: 400;
    color: var(--rw-muted);
}

.rw-price-retail { 
    font-size: 11px; 
    color: var(--rw-muted); 
    text-decoration: line-through; 
}

.rw-btn-stack { 
    display: flex; 
    flex-direction: column; 
    gap: 6px; 
    min-width: 120px; 
}

.rw-cart-btn { 
    background: var(--rw-nc-teal); 
    color: #fff; 
    text-decoration: none; 
    padding: 8px 14px; 
    border-radius: 6px; 
    font-weight: 600; 
    font-size: 13px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 6px; 
    transition: background 0.2s ease; 
}

.rw-cart-btn.disabled { 
    background: #e2e8f0 !important; 
    color: #94a3b8 !important; 
    pointer-events: none; 
    cursor: not-allowed; 
}

.rw-offer-btn { 
    background: #ffffff; 
    color: var(--rw-dark); 
    border: 1px solid var(--rw-border); 
    text-decoration: none; 
    padding: 8px 14px; 
    border-radius: 6px; 
    font-weight: 600; 
    font-size: 13px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 6px; 
    transition: all 0.2s ease; 
}

.rw-offer-btn:hover { 
    border-color: var(--rw-primary); 
    color: var(--rw-primary); 
    background: #f0fdfa; 
}

/*=========================================================
LOADING & ERROR BOX STYLING
=========================================================*/
.rw-loading { 
    text-align: center; 
    padding: 24px; 
    background: #fff; 
    border: 1px solid var(--rw-border); 
    border-radius: var(--rw-radius); 
    margin-top: 16px; 
}

.rw-spinner { 
    width: 28px; 
    height: 28px; 
    border: 3px solid var(--rw-border); 
    border-top-color: var(--rw-primary); 
    border-radius: 50%; 
    animation: spin 0.8s linear infinite; 
    margin: 0 auto 8px; 
}

@keyframes spin { 
    to { transform: rotate(360deg); } 
}

.rw-error-state[hidden] { 
    display: none !important; 
}

.rw-error-state { 
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px; 
    background: #fef2f2; 
    border: 1px solid #fecaca; 
    border-left: 4px solid var(--rw-nc-red);
    border-radius: var(--rw-radius); 
    margin-top: 16px; 
    box-shadow: 0 2px 8px rgba(217, 56, 30, 0.06);
    animation: rwFadeIn 0.25s ease-in-out;
}

.rw-error-state i { 
    font-size: 20px; 
    color: var(--rw-nc-red); 
    flex-shrink: 0;
}

.rw-error-state p { 
    margin: 0; 
    font-size: 13px; 
    font-weight: 500;
    color: #991b1b; 
    line-height: 1.5;
}

@keyframes rwFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/*=========================================================
ADVANCED MODAL
=========================================================*/
.rw-modal { 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.55); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 99999; 
    padding: 16px; 
}

.rw-modal[hidden] { 
    display: none !important; 
}

.rw-modal-dialog { 
    background: #fff; 
    padding: 24px; 
    border-radius: 12px; 
    width: 100%; 
    max-width: 480px; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); 
}

.rw-modal-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding-bottom: 12px; 
    margin-bottom: 16px; 
    border-bottom: 1px solid var(--rw-border); 
}

.rw-modal-close { 
    background: none; 
    border: none; 
    font-size: 22px; 
    color: var(--rw-muted); 
    cursor: pointer; 
}

.rw-help { 
    font-size: 11px; 
    color: var(--rw-muted); 
    margin: -6px 0 6px; 
}

.rw-length-grid { 
    display: flex; 
    gap: 10px; 
}

.rw-extension-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 10px; 
    margin-top: 4px; 
}

.rw-extension-grid label { 
    font-size: 13px; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    cursor: pointer; 
}

.rw-modal-footer { 
    display: flex; 
    gap: 10px; 
    justify-content: flex-end; 
    margin-top: 18px; 
    padding-top: 14px; 
    border-top: 1px solid var(--rw-border); 
}

/*=========================================================
DOMAIN LANDING PAGE ADDITIONAL SECTIONS
=========================================================*/
.rw-pricing-section,
.rw-features-section,
.rw-steps-section {
    padding: 48px 16px;
    width: 100%;
}

.rw-pricing-section { background: #f9f9f9; }
.rw-features-section { background: var(--rw-bg, #f8fafc); }
.rw-steps-section { background: #f9f9f9; border-top: 1px solid var(--rw-border, #e2e8f0); }

.rw-section-header {
    text-align: center;
    margin-bottom: 36px;
}

.rw-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #008181;
    margin: 0 0 8px;
}

.rw-section-subtitle {
    font-size: 14px;
    color: var(--rw-muted, #64748b);
    margin: 0;
}

.rw-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--rw-border, #e2e8f0);
    border-radius: var(--rw-radius, 8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.rw-pricing-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    text-align: left;
    font-size: 14px;
}

.rw-pricing-table th {
    background: #f1f5f9;
    padding: 14px 18px;
    font-weight: 600;
    color: var(--rw-dark, #0f172a);
    border-bottom: 1px solid var(--rw-border, #e2e8f0);
}

.rw-pricing-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--rw-border, #e2e8f0);
    color: var(--rw-dark, #0f172a);
}

.rw-tld-badge {
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
}

.rw-price-cell {
    font-weight: 700;
    color: var(--rw-primary, #008181);
}

.rw-price-cell small, .rw-renew-cell small {
    font-size: 11px;
    color: var(--rw-muted, #64748b);
    font-weight: 400;
}

.rw-renew-cell {
    color: var(--rw-muted, #64748b);
    font-weight: 500;
}

.rw-pricing-disclaimer {
    font-size: 11px;
    color: var(--rw-muted, #64748b);
    margin-top: 12px;
    text-align: right;
}

.rw-features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.rw-feature-card {
    background: #ffffff;
    border: 1px solid var(--rw-border, #e2e8f0);
    border-radius: var(--rw-radius, 8px);
    padding: 24px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.rw-feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--rw-primary, #008181);
}

.rw-feature-icon {
    width: 44px;
    height: 44px;
    background: #ccfbf1;
    color: #0f766e;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}

.rw-feature-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--rw-dark, #0f172a);
}

.rw-feature-card p {
    margin: 0;
    font-size: 13px;
    color: var(--rw-muted, #64748b);
    line-height: 1.5;
}

.rw-steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.rw-step-card {
    background: #f8fafc;
    border: 1px solid var(--rw-border, #e2e8f0);
    border-radius: var(--rw-radius, 8px);
    padding: 28px 20px;
    position: relative;
}

.rw-step-number {
    font-size: 14px;
    font-weight: 800;
    color: var(--rw-primary, #008181);
    background: #ccfbf1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.rw-step-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--rw-dark, #0f172a);
}

.rw-step-card p {
    margin: 0;
    font-size: 13px;
    color: var(--rw-muted, #64748b);
    line-height: 1.5;
}

.rw-steps-cta {
    text-align: center;
}

.rw-cta-btn {
    display: inline-flex;
    width: auto;
    padding: 0 32px;
    margin: 0 auto;
}


/* ====================================================
   WHOIS CUSTOM POPOVER CARD STYLING
   ==================================================== */
.rw-whois-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Hide when hidden attribute is present */
.rw-whois-popover[hidden] {
    display: none !important;
}

/* Display popover card when unhidden */
.rw-whois-popover {
    display: block;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #17284d;
    color: #00e6e6;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-line;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    min-width: 230px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* TOP TRIANGLE ARROW */
.rw-whois-popover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 12px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #17284d transparent;
}


/*=========================================================
RESPONSIVE BREAKPOINT (991px & BELOW)
=========================================================*/
@media (max-width: 991px) {
    .rw-app { 
        padding: 20px 12px; 
    }

    .rw-container { 
        max-width: 100%; 
    }

    .rw-switcher { 
        display: flex;
        flex-direction: row; 
        gap: 6px;
    }

    .rw-tab {
        flex: 1;
        width: 50%;
        font-size: 12px;
        padding: 0 8px;
    }

    .rw-quick-pills {
        justify-content: center;
        gap: 6px;
        margin-top: 10px;
    }

    .rw-pill {
        font-size: 8px;
        padding: 3px 8px;
    }

    .rw-nc-card { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 14px; 
        padding: 14px;
    }

    .rw-nc-domain-row {
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
    }

    .rw-domain-name {
        font-size: 15px;
    }

    .rw-nc-check-icon {
        font-size: 14px;
        flex-shrink: 0;
    }

    .rw-registered-badge {
        font-size: 8px;
        padding: 2px 5px;
        white-space: nowrap;
    }

    .rw-promo-badge { 
        font-size: 8px; 
        padding: 2px 6px;
    }

    .rw-score-badge {
        font-size: 8px;
        padding: 2px 6px;
        line-height: 1.2;
        flex-shrink: 0;
    }

    .rw-whois-info,
    .rw-fav-star {
        font-size: 13px;
        padding: 2px;
    }

    .rw-nc-right { 
        width: 100%; 
        justify-content: space-between; 
        border-top: 1px solid #f1f5f9; 
        padding-top: 10px; 
    }

    .rw-pricing-block { 
        text-align: left; 
    }

    .rw-price-main { 
        font-size: 15px; 
    }

    .rw-price-main small {
        font-size: 10px;
    }

    .rw-price-retail { 
        font-size: 9px; 
    }

   .rw-btn-stack {
        width: 100%;
        min-width: 180px;        /* Gives side-by-side buttons enough room */
        flex-direction: row;
        gap: 8px;
    }

/* FIX BUTTON TEXT WRAPPING & ALIGNMENT */
    .rw-cart-btn,
    .rw-offer-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 8px 10px;       /* Reduced horizontal padding */
        font-size: 11.5px;       /* Keeps text on a single clean line */
        white-space: nowrap;     /* Forces "Make Offer" onto 1 line */
        box-sizing: border-box;
    }
    
    .rw-cart-btn span,
    .rw-offer-btn span {
        white-space: nowrap;     /* Ensures nested span tags don't break */
    }

    .rw-extension-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }

    .rw-results-bar { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 8px; 
    }

    .rw-action-group { 
        width: 100%; 
    }

    .rw-action-btn { 
        flex: 1; 
        justify-content: center; 
    }

    .rw-error-state {
        padding: 14px;
        gap: 10px;
    }

    .rw-pricing-section, .rw-features-section, .rw-steps-section {
        padding: 32px 12px;
    }

    .rw-table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .rw-section-title {
        color: #008181;
        font-size: 20px;
    }

    .rw-pricing-table {
        min-width: 600px;
    }

    .rw-pricing-table th, 
    .rw-pricing-table td {
        padding: 14px 16px;
        font-size: 13px;
        white-space: nowrap;
    }

    .rw-pricing-table td:last-child {
        white-space: normal;
        min-width: 200px;
    }

    .rw-features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .rw-feature-card {
        padding: 28px 20px;
        background: #f8fafc;
    }

    .rw-steps-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .rw-cta-btn {
        width: 100%;
    }
    
    
    
/* WHOIS PREVIEW */
    .rw-whois-popover {
        left: -10px;
        font-size: 11px;
        padding: 10px 14px;
        min-width: 210px;
    }
    
    .rw-whois-popover::before {
        left: 16px;
    }


}