/**
 * Admin Styles
 */

/* Fix SVG sizes in admin buttons */
#tryloom-admin-wrap .button svg,
#tryloom-admin-wrap button svg,
#tryloom-admin-wrap .tryloom-admin__settings-container svg {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 8px;
    margin-top: -2px;
}

/* Tab Navigation */
#tryloom-admin-wrap .tryloom-admin-tabs {
    margin-bottom: 25px;
    padding-top: 10px;
}

/* Stats Grid Layout */
#tryloom-admin-wrap .tryloom-admin__stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto;
    gap: 20px;
    margin-bottom: 20px;
}

#tryloom-admin-wrap .tryloom-admin__stat-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
    display: flex;
    flex-direction: column;
    height: 100%;
}

#tryloom-admin-wrap .tryloom-admin__stat-card-header {
    border-bottom: 1px solid #c3c4c7;
    padding: 10px 15px;
    background-color: #f9f9f9;
}

#tryloom-admin-wrap .tryloom-admin__stat-card-header h2 {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
}

#tryloom-admin-wrap .tryloom-admin__stat-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

#tryloom-admin-wrap .tryloom-admin__header {
    background: #fff;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}

#tryloom-admin-wrap .tryloom-admin__header-info p {
    font-size: 16px;
    margin: 0;
    font-weight: 500;
}

#tryloom-admin-wrap .tryloom-admin__settings-container {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    max-width: 1200px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

#tryloom-admin-wrap .tryloom-admin__footer {
    border-top: 1px solid #eee;
    margin-top: 40px;
    padding-top: 20px;
}

/* Dashboard Widget */
#tryloom-admin-wrap .tryloom-admin__dashboard-widget {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

#tryloom-admin-wrap .tryloom-admin__stat-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e2e4e7;
    text-align: center;
}

#tryloom-admin-wrap .tryloom-admin__stat-box h4 {
    margin: 0 0 10px 0;
    color: #646970;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#tryloom-admin-wrap .tryloom-admin__stat-box .stat-number {
    font-size: 24px;
    font-weight: 600;
    color: #552FBC;
    margin: 0 0 5px 0;
}

#tryloom-admin-wrap .tryloom-admin__stat-box .description {
    font-size: 12px;
    color: #787c82;
    margin: 0;
}

/* Tooltip Styles */
#tryloom-admin-wrap .tryloom-admin__help-tip {
    position: relative;
    display: inline-block;
    cursor: help;
    margin-left: 0;
    /* Dotted underline to hint it's hoverable */
    border-bottom: 1px dotted #50575e;
    line-height: 1.4;
    vertical-align: baseline;
}

/* No ? icon - tooltip triggers on text hover only */
#tryloom-admin-wrap .tryloom-admin__help-tip::before,
#tryloom-admin-wrap .tryloom-admin__help-tip::after {
    content: none;
}

#tryloom-admin-wrap .tryloom-admin__tooltip-content {
    visibility: hidden;
    width: 230px;
    background-color: #1d2327;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 8px 10px;
    position: absolute;
    z-index: 9999;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 12px;
    line-height: 1.4;
    font-weight: normal;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    /* Hover bridge: invisible padding that connects tooltip to the text
       so moving the mouse upward into the tooltip keeps it open */
    padding-bottom: 14px;
    margin-bottom: -6px;
}

#tryloom-admin-wrap .tryloom-admin__tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    /* Account for padding-bottom bridge */
    margin-top: -6px;
    border-width: 5px;
    border-style: solid;
    border-color: #1d2327 transparent transparent transparent;
}

#tryloom-admin-wrap .tryloom-admin__help-tip:hover .tryloom-admin__tooltip-content {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    /* allow mouse events inside tooltip so links are clickable */
}

/* Tooltip Link */
#tryloom-admin-wrap .tryloom-admin__tooltip-content a {
    color: #fff;
    text-decoration: underline;
    pointer-events: auto;
    /* Allow clicking links */
}

/* Stats Styles (Settings Page) */
#tryloom-admin-wrap .tryloom-admin__daily-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
}

#tryloom-admin-wrap .tryloom-admin__daily-stat-box {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #c3c4c7;
    text-align: center;
    box-sizing: border-box;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

/* Dashboard Widget Fixes (If used elsewhere with different class) */
#tryloom-admin-wrap .tryloom-admin__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

#tryloom-admin-wrap .tryloom-admin__stats-item {
    background: #f0f0f1;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}

#tryloom-admin-wrap .tryloom-admin__stats-item h4 {
    margin: 0 0 5px;
    font-size: 12px;
}

#tryloom-admin-wrap .tryloom-admin__stats-number {
    font-size: 20px;
    font-weight: bold;
    color: #552FBC;
    margin: 0;
}

/* =============================================
   Bug 5: Subscription Button Styling
   ============================================= */
#tryloom-admin-wrap .tryloom-admin__header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

#tryloom-admin-wrap .tryloom-admin__header-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

#tryloom-admin-wrap .tryloom-admin__header-actions .button-primary {
    background: #552FBC;
    color: #fff !important;
}

#tryloom-admin-wrap .tryloom-admin__header-actions .button-primary:hover {
    background: #4325a0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(85, 47, 188, 0.3);
}

#tryloom-admin-wrap .tryloom-admin__header-actions .button-secondary,
#tryloom-admin-wrap .tryloom-admin__header-actions .button:not(.button-primary) {
    background: #3c434a;
    color: #fff !important;
}

#tryloom-admin-wrap .tryloom-admin__header-actions .button-secondary:hover,
#tryloom-admin-wrap .tryloom-admin__header-actions .button:not(.button-primary):hover {
    background: #2c3338;
    transform: translateY(-1px);
}

/* =============================================
   Bug 6: Sticky Save Changes Button
   ============================================= */
#tryloom-admin-wrap .tryloom-admin__form {
    position: relative;
    padding-bottom: 80px;
}

#tryloom-admin-wrap .tryloom-admin__form .submit {
    margin-left: -20px;
    margin-right: -20px;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0px 20px;
    /* margin-top: 20px; */
    z-index: 100;
    width: 100%;
}

#tryloom-admin-wrap .tryloom-admin__form #submit {
    background: #552FBC;
    border-color: #552FBC;
    color: #fff;
    padding: 5px 30px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    margin: 10px;
}

#tryloom-admin-wrap .tryloom-admin__form #submit:hover {
    background: #4325a0;
    border-color: #4325a0;
    box-shadow: 0 4px 12px rgba(85, 47, 188, 0.3);
}

/* =============================================
   Refactored Inline Styles Utilities
   ============================================= */
#tryloom-admin-wrap .tryloom-admin__settings-details {
    margin-top: 5px;
    border: 1px solid #ccd0d4;
    padding: 15px;
    background: #fff;
    max-width: 600px;
}

#tryloom-admin-wrap .tryloom-admin__settings-summary {
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

#tryloom-admin-wrap .tryloom-admin__settings-desc-box {
    margin-top: 15px;
}

#tryloom-admin-wrap .tryloom-admin__settings-th {
    padding-left: 0;
    padding-bottom: 5px;
}

#tryloom-admin-wrap .tryloom-admin__settings-td {
    padding-bottom: 5px;
}

#tryloom-admin-wrap .tryloom-admin__select-wide {
    width: 400px;
}

#tryloom-admin-wrap .tryloom-admin__italic-hint {
    margin-left: 10px;
    font-style: italic;
    color: #666;
}

#tryloom-admin-wrap .tryloom-admin__shortcode-list {
    list-style: disc;
    padding-left: 20px;
}

/* Stats Inside Cards */
#tryloom-admin-wrap .tryloom-admin__stat-row {
    flex-direction: row;
    justify-content: space-around;
    text-align: center;
    width: 100%;
}

#tryloom-admin-wrap .tryloom-admin__stat-title {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #646970;
}

#tryloom-admin-wrap .tryloom-admin__stat-value {
    margin: 5px 0 0;
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
}

#tryloom-admin-wrap .tryloom-admin__stat-divider {
    border-left: 1px solid #dcdcde;
    margin: 0 15px;
}

#tryloom-admin-wrap .tryloom-admin__clear {
    clear: both;
}

#tryloom-admin-wrap .tryloom-radio-group {
    display: flex;
    gap: 25px;
    margin: 10px 0;
    align-items: center;
}

#tryloom-admin-wrap .tryloom-radio-label {
    align-items: center;
    cursor: pointer;
}

#tryloom-admin-wrap .tryloom-admin__usage-flex {
    justify-content: space-between;
    width: 100%;
}

#tryloom-admin-wrap .tryloom-admin__usage-desc {
    margin: 0;
    margin-right: 15px;
}

#tryloom-admin-wrap .tryloom-admin__usage-val {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2271b1;
    white-space: nowrap;
}

#tryloom-admin-wrap .tryloom-admin__usage-sub {
    color: #646970;
    font-size: 16px;
}

#tryloom-admin-wrap .tryloom-admin__sub-flex {
    justify-content: flex-start;
    width: 100%;
}

#tryloom-admin-wrap .tryloom-admin__sub-actions {
    margin: 0;
}

#tryloom-admin-wrap .tryloom-admin__margin-right-10 {
    margin-right: 10px;
}

#tryloom-admin-wrap .tryloom-admin__privacy-quote {
    background: #f4f4f4;
    padding: 12px 16px;
    border-left: 4px solid var(--tryloom-primary-color, #552FBC);
    border-radius: 4px;
}

#tryloom-admin-wrap .tryloom-admin__preview-img {
    max-width: 100%;
    height: auto;
}

/* Second tooltip block - override/reset to match above */
#tryloom-admin-wrap .tryloom-admin__help-tip {
    display: inline-block;
    margin-left: 0;
    color: inherit;
    cursor: help;
    position: relative;
    font-size: inherit;
    border-bottom: 1px dotted #50575e;
}

#tryloom-admin-wrap .tryloom-admin__help-tip::after {
    content: none;
}

#tryloom-admin-wrap .tryloom-admin__tooltip-content {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e1e1e;
    color: #fff;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
    white-space: normal;
    width: max-content;
    max-width: 250px;
    z-index: 10000;
    font-weight: normal;
    text-align: center;
    /* Hover bridge so mouse can travel into tooltip without it closing */
    padding-bottom: 16px;
    margin-bottom: -8px;
    pointer-events: none;
}

#tryloom-admin-wrap .tryloom-admin__tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: -8px;
    border-width: 6px;
    border-style: solid;
    border-color: #1e1e1e transparent transparent transparent;
}

#tryloom-admin-wrap .tryloom-admin__help-tip:hover .tryloom-admin__tooltip-content {
    display: block;
    pointer-events: auto;
}