/**
 * Public-facing styles for Goldback Tools
 */

/* Base variables */
.goldback-tools-panel {
    --goldback-primary: #475569;
    --goldback-background: #f8fafc;
    --goldback-accent: #D4AF37;
    --goldback-tab: #475569;
    --goldback-text: #1e293b;
    --goldback-light-gray: #f1f5f9;
    --goldback-border: #e2e8f0;
    --goldback-success: #16a34a;
    --goldback-warning: #eab308;
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
}

.goldback-tools-panel * {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif !important;
    --goldback-error: #dc2626;
    --goldback-shadow: rgba(0, 0, 0, 0.1);
    --goldback-transition: all 0.3s ease;
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: var(--goldback-text);
    line-height: 1.5;
}

/* Remove default border style from inputs */
.goldback-tools-panel input, 
.goldback-tools-panel input:not([type=submit]), 
.goldback-tools-panel select, 
.goldback-tools-panel textarea {
    border-style: none;
}

/* Panel Structure */
.goldback-tools-panel {
    position: fixed;
    right: 0;
    top: 0;
    height: 100%;
    z-index: 999999;
    display: flex;
    pointer-events: none;
}

.goldback-tools-wrapper {
    display: flex;
    height: 100%;
    pointer-events: auto;
}

.goldback-tools-tab-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 80px;
    background-color: var(--goldback-tab);
    color: white;
    cursor: pointer;
    align-self: center;
    border-radius: 8px 0 0 8px;
    transition: var(--goldback-transition);
    box-shadow: -2px 0 5px var(--goldback-shadow);
}

.goldback-tools-tab-button:hover {
    background-color: var(--goldback-tab);
    opacity: 0.9;
}

.goldback-tools-arrow-icon {
    position: absolute;
    left: 14px;
    bottom: 10px;
    stroke: white;
    transition: var(--goldback-transition);
}

.goldback-tools-panel.open .goldback-tools-arrow-icon {
    transform: rotate(180deg);
}

.goldback-tools-panel-content {
    width: 0;
    height: 100%;
    background-color: var(--goldback-background);
    overflow: hidden;
    transition: width 0.3s ease;
    box-shadow: -2px 0 10px var(--goldback-shadow);
}

.goldback-tools-panel.open .goldback-tools-panel-content {
    width: 500px;
    overflow-y: auto;
}

/* Header Styles */
.goldback-tools-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--goldback-border);
}

.goldback-tools-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.goldback-tools-logo {
    height: 30px;
    width: auto;
}

.goldback-tools-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--goldback-primary);
}

.goldback-tools-close-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--goldback-text);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.goldback-tools-close-button:hover {
    color: var(--goldback-primary);
}

/* Tabs Styles */
.goldback-tools-tabs {
    display: flex;
    flex-direction: column;
}

.goldback-tools-tabs-list {
    display: flex;
    border-bottom: 1px solid var(--goldback-border);
}

.goldback-tools-tabs-trigger {
    flex: 1;
    padding: 12px 15px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--goldback-text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--goldback-transition);
}

.goldback-tools-tabs-trigger[data-state='active'] {
    color: var(--goldback-primary);
    border-bottom-color: var(--goldback-primary);
}

.goldback-tools-tabs-trigger:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.goldback-tools-tab-panel {
    display: none;
    padding: 20px;
}

.goldback-tools-tab-panel[data-state='active'] {
    display: block;
}

/* Price Tracker Styles */
.goldback-tools-price-tracker {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.goldback-tools-price-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: var(--goldback-primary);
}

.goldback-tools-current-price {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 15px 0;
    border-bottom: 1px solid #e2e8f0;
}

.goldback-tools-current-price-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--goldback-text);
}

.goldback-tools-current-price-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--goldback-primary);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.goldback-number-label {
    color: var(--goldback-primary);
    font-weight: 600;
}

#goldback-price-value {
    color: var(--goldback-primary);
}

.gb-icon-large {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--goldback-primary);
}

.gb-icon-large svg {
    color: var(--goldback-primary);
    fill: var(--goldback-primary);
}

.goldback-tools-price-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.goldback-tools-price-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: var(--goldback-light-gray);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--goldback-border);
    border-top: 2px solid var(--goldback-border);
    transition: var(--goldback-transition);
}

.goldback-tools-price-card:hover {
    transform: translateY(-2px);
    border-top-color: var(--goldback-primary);
    box-shadow: 0 4px 6px var(--goldback-shadow);
}

.goldback-tools-price-denomination {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.goldback-tools-price-denomination .gb-icon {
    margin-right: 12px;
}

.goldback-tools-price-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--goldback-primary);
}

.goldback-tools-last-updated {
    font-size: 12px;
    color: #64748b;
    text-align: center;
}

/* Calculator Styles */
.goldback-tools-calculator {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 5px 0;
}

.goldback-tools-exchange-rate {
    text-align: left;
    margin-bottom: 5px;
}

.goldback-tools-exchange-rate-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--goldback-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

#goldback-price-value-calculator {
    color: var(--goldback-primary);
    font-size: 26px;
}

.goldback-tools-exchange-rate-label {
    font-size: 20px;
    font-weight: 600;
    color: var(--goldback-primary);
    margin: 0;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.goldback-tools-divider {
    border: 0;
    height: 1px;
    background-color: #e2e8f0;
    margin: 10px 0;
}

.goldback-tools-calculator-title {
    font-size: 24px;
    font-weight: 600;
    margin: 5px 0;
    color: var(--goldback-primary);
}

.goldback-tools-calculator-form {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 5px;
}

.goldback-tools-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 25px;
    width: 100%;
}

/* Specific styling for Denomination field to be on one line */
.goldback-tools-field:first-child {
    flex-direction: row;
    align-items: center;
}

.goldback-tools-field:first-child .goldback-tools-label {
    width: 230px;
    margin-bottom: 0;
}

.goldback-tools-field:first-child .goldback-tools-select {
    width: calc(100% - 230px);
    margin-left: 0;
}

.goldback-tools-label {
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 10px;
    display: block;
}

.goldback-tools-select {
    padding: 5px 0;
    border: solid;
    border-left: 0px;
    border-right: 0px;
    border-top: 0px;
    border-width: 2px;
    border-bottom-color: #475569;
    background-color: #f8fafc;
    font-size: 18px;
    outline: none;
    width: 100%;
    border-radius: 0;
    color: #475569;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23475569%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0 top 50%;
    background-size: 0.65em auto;
    padding-right: 1.5em;
    font-family: 'Lato', sans-serif;
    text-transform: uppercase;
    position: relative;
}

.goldback-tools-select:focus {
    border-bottom-color: var(--goldback-accent);
}

/* Styling for dropdown */
.goldback-tools-select option {
    padding: 15px 10px;
    font-size: 18px;
    font-family: 'Lato', sans-serif;
    color: #475569;
    background-color: white;
    border: none;
}

/* Styling for select dropdown */
select.goldback-tools-select {
    appearance: none;
    cursor: pointer;
    border: solid;
    border-right: 0px;
    border-left: 0px;
    border-top: 0px;
    border-width: 2px;
    border-bottom-color: #475569;
}

select.goldback-tools-select:focus {
    outline: none;
    border-bottom-color: var(--goldback-accent);
}

/* Custom dropdown styles - these will be applied by the browser */
select.goldback-tools-select::-ms-expand {
    display: none;
}

/* Apply custom styles to the select element using JavaScript */
.goldback-tools-select-container {
    position: relative;
}

/* Style for selected option */
.goldback-tools-select option:checked {
    background-color: #3b4253;
    color: white;
    display: flex;
    align-items: center;
}

/* Checkmark styling */
.goldback-tools-select option svg {
    margin-right: 8px;
    color: white;
}

/* Style for hover state */
.goldback-tools-select option:hover {
    background-color: #f1f5f9;
}

/* Adding some browser-specific styles */
@-moz-document url-prefix() {
    .goldback-tools-select {
        text-indent: 0.01px;
        text-overflow: '';
        padding-right: 1em;
    }
    
    .goldback-tools-select option {
        background-color: white;
        color: #475569;
    }
    
    .goldback-tools-select option:checked {
        background-color: #3b4253;
        color: white;
        box-shadow: 0 0 10px 100px #3b4253 inset;
    }
}

/* Chrome, Safari specific styling */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    .goldback-tools-select option:checked {
        background-color: #3b4253 !important;
        color: white !important;
    }
}

.goldback-tools-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    border: solid;
    border-left: 0px;
    border-right: 0px;
    border-top: 0px;
    border-width: 2px;
    border-bottom-color: #475569;
}

.goldback-tools-input-prefix {
    position: absolute;
    left: 0;
    font-size: 20px;
    font-weight: 600;
    color: #475569;
}

.goldback-tools-input {
    padding: 12px 0;
    padding-left: 32px;
    border: none;
    background-color: #f8fafc;
    font-size: 18px;
    width: 100%;
    outline: none;
    color: #475569;
    font-family: 'Lato', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.goldback-tools-input:focus {
    outline: none;
}

.goldback-tools-input-wrapper:focus-within {
    border-bottom-color: var(--goldback-accent);
}

.goldback-tools-input::placeholder {
    color: #94a3b8;
    font-family: 'Lato', sans-serif;
    text-transform: uppercase;
}

.gb-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 4px;
    vertical-align: middle;
}

.gb-icon-large {
    display: inline-block;
    width: 40px;
    height: 40px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Due Sections */
.goldback-tools-due {
    padding: 12px;
    border-radius: 0;
    margin: 12px 0;
}

.goldback-tools-due-yellow {
    background-color: #fef9c3;
    color: #854d0e;
    border-left: 4px solid #eab308;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 12px;
}

.goldback-tools-due-label-yellow {
    font-weight: 600;
    font-size: 20px;
    text-transform: uppercase;
    color: black;
    padding-left: 10px;
}

.goldback-separator {
    margin: 0 2px;
}

.goldback-tools-due-red {
    background-color: #b91c1c;
    color: white;
    border-left: 4px solid #7f1d1d;
}

.goldback-tools-due-green {
    background-color: var(--goldback-success);
    color: white;
    border-left: 4px solid #166534;
}

.goldback-tools-due-rows {
    width: 100%;
}

.goldback-tools-due-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0;
    padding-bottom: 0;
}

.goldback-tools-due-bottom-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    gap: 8px;
}

.goldback-tools-due-label {
    font-weight: 600;
    font-size: 20px;
    text-transform: uppercase;
    color: white;
    padding-left: 10px;
}

.goldback-tools-due-value {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 20px;
    font-weight: 700;
    padding-right: 10px;
}

.goldback-tools-or-text {
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    margin-right: 5px;
}

.goldback-tools-goldback-value {
    display: flex;
    align-items: center;
    gap: 2px;
}

.goldback-tools-due-red .gb-icon svg,
.goldback-tools-due-red .gb-icon path {
    color: white;
    fill: white;
}

.goldback-tools-plus-sign {
    font-size: 20px;
    margin: 0 5px;
    color: white;
}

/* Due Change Section */
#goldback-due-change {
    color: white;
}

#goldback-due-change #goldback-due-amount {
    color: white;
}

#goldback-due-change #goldback-due-goldbacks-alt,
#goldback-due-change #goldback-due-cash {
    color: white;
    font-size: 20px;
    font-weight: 600;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .goldback-tools-panel.open .goldback-tools-panel-content {
        width: 100vw;
    }
    
    .goldback-tools-panel.open .goldback-tools-tab-button {
        display: none;
    }
    
    .goldback-tools-price-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Mobile-specific spacing adjustments */
    .goldback-tools-due-yellow,
    .goldback-tools-due-red,
    .goldback-tools-due-green {
        padding: 12px 10px;
    }
    
    .goldback-tools-due-label-yellow,
    .goldback-tools-due-label {
        font-size: 18px;
        padding-left: 8px;
    }
    
    .goldback-tools-due-value {
        font-size: 18px;
        padding-right: 8px;
    }
    
    .goldback-tools-or-text {
        font-size: 18px;
    }
    
    .goldback-tools-exchange-rate-label {
        letter-spacing: 0.5px;
    }
    
    .goldback-tools-exchange-rate {
        margin-bottom: 3px;
    }
    
    .goldback-tools-calculator-title {
        margin: 3px 0;
        font-size: 22px;
    }
    
    .goldback-tools-divider {
        margin: 8px 0;
    }
    
    .goldback-tools-field {
        margin-bottom: 18px;
    }
    
    .goldback-tools-field:first-child {
        margin-bottom: 15px;
    }
    
    .goldback-tools-label {
        margin-bottom: 8px;
        font-size: 18px;
    }
    
    .goldback-tools-input, 
    .goldback-tools-select {
        padding: 10px 0;
    }
}