/**
 * Smart Convert – Currency & Unit Conversion - Main Stylesheet
 * * Contains styles for the Gutenberg Block, Onboarding Page, and common UI elements.
 * moved from inline scripts/PHP to this external file for better performance and CSP compliance.
 */

/* ==========================================================================
   Gutenberg Block Editor UI (.smart-convert-currency-unit-conversion-block-editor-ui)
   ========================================================================== */

/* Main Card Container */
.smart-convert-currency-unit-conversion-block-editor-ui {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 20px !important;
    box-shadow: 0 4px 10px rgba(130, 199, 196, 0.15) !important; /* var(--smart-convert-currency-unit-conversion-shadow-card) fallback */
    background: linear-gradient(135deg, #e2f4f2 0%, #faf5ed 100%);
}

.smart-convert-currency-unit-conversion-block-editor-ui h4 {
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Input Fields Overrides for Block Editor */
/* Force white background on inputs within the custom UI to stand out against the gradient */
.smart-convert-currency-unit-conversion-block-editor-ui .components-base-control__field .components-flex,
.smart-convert-currency-unit-conversion-block-editor-ui .components-input-control__container,
.smart-convert-currency-unit-conversion-block-editor-ui input[type="text"],
.smart-convert-currency-unit-conversion-block-editor-ui input[type="number"] { 
    background-color: #ffffff !important; 
    border-radius: 2px; 
}

/* Field Wrappers */
.smart-convert-currency-unit-conversion-field-wrapper {
    margin-bottom: 15px;
}

/* Custom Labels inside the block */
.smart-convert-currency-unit-conversion-field-label {
    font-weight: 600;
    font-size: 13px;
    display: block;
    margin-bottom: 4px;
    color: #1e1e1e;
}

/* Custom Hints inside the block */
.smart-convert-currency-unit-conversion-field-hint {
    color: #757575;
    font-size: 12px;
    margin-top: 0;
    margin-bottom: 8px;
    line-height: 1.4;
}


/* ==========================================================================
   Live Preview & Tooltips
   ========================================================================== */

.smart-convert-currency-unit-conversion-block-preview-container {
    position: relative;
    all: initial;
    display: block;
    font-family: inherit;
}

.smart-convert-currency-unit-conversion-preview-title {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    font-family: sans-serif;
}

/* The Trigger Element (Bubble) */
.smart-convert-currency-unit-conversion-block-preview-container .smart-convert-currency-unit-conversion-bubble {
    color: rgb(117, 117, 117);
    border-bottom: 1px dotted black;
    margin: 0 0.5rem;
    cursor: help;
    position: relative;
}

/* Tooltip Text (Hidden by default) */
.smart-convert-currency-unit-conversion-block-preview-container .smart-convert-currency-unit-conversion-tooltip-text {
    display: none !important;
}

/* Show Tooltip on Hover */
.smart-convert-currency-unit-conversion-block-preview-container .smart-convert-currency-unit-conversion-bubble:hover .smart-convert-currency-unit-conversion-tooltip-text {
    display: block !important;
    position: absolute !important;
    z-index: 100 !important;
    bottom: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-bottom: 5px !important;
    background-color: #333 !important;
    color: #fff !important;
    padding: 5px 10px !important;
    border-radius: 4px !important;
    width: max-content !important;
    max-width: 200px !important;
    text-align: center !important;
    font-size: 12px !important;
    pointer-events: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    white-space: nowrap !important;
}

/* Tooltip Arrow */
.smart-convert-currency-unit-conversion-block-preview-container .smart-convert-currency-unit-conversion-bubble:hover .smart-convert-currency-unit-conversion-tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}


/* ==========================================================================
   Onboarding Page Styles
   ========================================================================== */

.smart-convert-currency-unit-conversion-onboarding-body {
    background-color: #f0f0f1; /* WP default background */
}

.smart-convert-currency-unit-conversion-onboarding-wrapper {
    max-width: 550px;
    margin: 60px auto;
    background: #FFFFFF;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(130, 199, 196, 0.15); 
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    font-family: 'Figtree', sans-serif;
    color: #1A2F45;
}

.smart-convert-currency-unit-conversion-hero-icon { 
    font-size: 64px; 
    margin-bottom: 20px; 
    display: block; 
    line-height: 1; 
    text-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.smart-convert-currency-unit-conversion-onboarding-wrapper h1 { 
    font-size: 2em; 
    margin-bottom: 15px; 
    color: #1A2F45; 
    font-weight: 700; 
    letter-spacing: -0.5px;
}

.smart-convert-currency-unit-conversion-onboarding-wrapper p.smart-convert-currency-unit-conversion-intro-text { 
    font-size: 1.1em; 
    color: #50667d;
    line-height: 1.6; 
    margin-bottom: 40px; 
}

/* Consent Checkbox Styling */
.smart-convert-currency-unit-conversion-consent-wrapper {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #F7FCFB;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.smart-convert-currency-unit-conversion-hidden-cb {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.smart-convert-currency-unit-conversion-custom-label {
    font-size: 16px;
    font-weight: 500;
    color: #1A2F45;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    user-select: none;
    transition: color 0.2s;
}

/* Custom Checkbox Box */
.smart-convert-currency-unit-conversion-custom-box {
    width: 24px;
    height: 24px;
    background: #fff;
    border: 2px solid #ccd0d4;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.smart-convert-currency-unit-conversion-custom-label:hover .smart-convert-currency-unit-conversion-custom-box {
    border-color: #FF6B81;
}

.smart-convert-currency-unit-conversion-hidden-cb:checked + .smart-convert-currency-unit-conversion-custom-label .smart-convert-currency-unit-conversion-custom-box {
    background: #FF6B81;
    border-color: #FF6B81;
    box-shadow: 0 2px 5px rgba(255, 107, 129, 0.3);
}

/* Checkmark */
.smart-convert-currency-unit-conversion-custom-box::after {
    content: '';
    display: none;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.smart-convert-currency-unit-conversion-hidden-cb:checked + .smart-convert-currency-unit-conversion-custom-label .smart-convert-currency-unit-conversion-custom-box::after {
    display: block;
}

/* Connect Button */
.smart-convert-currency-unit-conversion-btn-connect {
    background: #FF6B81; 
    color: #fff; 
    border: none;
    padding: 16px 40px; 
    font-size: 1.1em; 
    font-weight: 600;
    border-radius: 10px; 
    cursor: pointer; 
    transition: all 0.3s ease;
    text-decoration: none; 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 15px rgba(255, 107, 129, 0.25);
    min-width: 260px;
}

.smart-convert-currency-unit-conversion-btn-connect:hover { 
    background: #e6566e; 
    color: #fff; 
    transform: translateY(-2px); 
    box-shadow: 0 8px 20px rgba(255, 107, 129, 0.35);
}

.smart-convert-currency-unit-conversion-btn-connect:disabled,
.smart-convert-currency-unit-conversion-btn-connect.disabled {
    background: #e2e8f0;
    color: #a0a0a0;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.smart-convert-currency-unit-conversion-loader { 
    display: none; 
    margin-top: 30px; 
    color: #50667d; 
    font-size: 1.1em; 
    font-weight: 500; 
}

.smart-convert-currency-unit-conversion-legal-small { 
    font-size: 0.85em !important; 
    color: #a7aaad !important; 
    margin-top: 40px !important; 
}