/**
 * Alt Goblin - Main Stylesheet
 * Styles for the Alt Goblin plugin interface
 */

:root {
    --altgo-primary-color: #2C363F;
    --altgo-secondary-color: #2EC4B6;
    --altgo-secondary-hover: #29b0a3;
    --altgo-primary-hover: #3b4855;
    --altgo-border-color: #ccc;
    --altgo-bg-color: #fff;
    --altgo-spacing-sm: 8px;
    --altgo-spacing-md: 10px;
    --altgo-spacing-lg: 20px;
    --altgo-white: #fff;
    --altgo-grey: #4C4C4C;
}

/* Keywords Section */
.altgo-keywords-section {
    margin: 0;
}

/* Toggle Switch Styles */
.altgo-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    margin-block-start: 10px;
}

.altgo-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background-color: #ccc;
    border-radius: 12px;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.altgo-toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: left 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.altgo-toggle-label[data-active="true"] .altgo-toggle-switch {
    background-color: var(--altgo-primary-color);
}

.altgo-toggle-label[data-active="true"] .altgo-toggle-switch::after {
    left: 22px;
}

.altgo-toggle-text {
    font-weight: 500;
    color: #333;
}

.attachment-details .field input[type=checkbox] {
    margin: 0;
    margin-inline-end: 4px;
}

/* Main Controls Wrapper */
.altgo-controls-wrapper {
    border: 1px solid var(--altgo-border-color);
    background-color: var(--altgo-bg-color);
    border-radius: 4px;
    overflow: hidden;
}

.compat-field-altgo_controls .field {
    float: left;
    width: 99.8%;
}

/* Header */
.altgo-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--altgo-border-color);
    background: #f7f7f7;
}

.altgo-controls-header h3 {
    margin: 0;
    padding: var(--altgo-spacing-md) var(--altgo-spacing-lg);
    font-size: 1.125em;
    font-weight: 600;
}

/* Body */
.altgo-controls-body {
    padding-inline: var(--altgo-spacing-lg);
    padding-block: 15px;
}

/* Keywords Input */
.altgo-keywords-input-wrapper {
    transition: opacity 0.2s ease-in-out;
    margin-top: var(--altgo-spacing-sm);
}

/* Button */
.altgo-button {
    background-color: var(--altgo-primary-color);
    border: none;
    padding: var(--altgo-spacing-md) 20px;
    color: var(--altgo-bg-color);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.2s ease;
    font-weight: 500;
    text-decoration: none;
}

.altgo-button--buy {
    padding: 15px 35px;
}

.altgo-button--generate {
    display: flex;
    align-items: center;
    gap: 6px;
}

.altgo-button--generate::before {
    content: url('data:image/svg+xml; utf8, <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 92 97"><path fill="%23fff" d="M31.027 1.85c1.007-2.467 4.501-2.467 5.509 0l7.986 19.56c.302.741.89 1.328 1.63 1.63l19.56 7.987c2.467 1.007 2.467 4.501 0 5.509l-19.56 7.986c-.74.302-1.328.89-1.63 1.63l-7.986 19.56c-1.008 2.467-4.502 2.467-5.51 0l-7.985-19.56a2.975 2.975 0 0 0-1.63-1.63L1.85 36.536c-2.468-1.008-2.468-4.502 0-5.51l19.56-7.985a2.975 2.975 0 0 0 1.63-1.63l7.986-19.56ZM67.807 51.114c.437-1.069 1.95-1.069 2.386 0l5.885 14.415c.13.32.385.575.706.706l14.415 5.885c1.068.436 1.068 1.949 0 2.385l-14.415 5.886c-.32.13-.575.385-.706.705l-5.885 14.415c-.437 1.069-1.95 1.069-2.386 0l-5.885-14.415a1.288 1.288 0 0 0-.706-.706l-14.415-5.885c-1.068-.436-1.068-1.949 0-2.385l14.415-5.886c.32-.13.575-.385.706-.705l5.885-14.415Z"/></svg>'); 
    display: block;
    width: 18px;
    transform: translateY(2px);
}

.altgo-button:hover:not(:disabled),
.altgo-button:focus:not(:disabled),
.altgo-button:active:not(:disabled) {
    background-color: var(--altgo-primary-hover);
    color: var(--altgo-white);
}

.altgo-button:active:not(:disabled) {
    transform: translateY(0);
}

.altgo-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading state animation */
@keyframes altgo-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.altgo-button--loading::before {
    animation: altgo-spin 1s linear infinite;
    transform-origin: center;
}

/* Hide default labels */
.compat-field-altgo_controls .alignleft:first-child,
.compat-field-altgo_controls .label:first-child {
    display: none;
}

/* Notes */
.altgo-controls-notes {
    display: block;
    margin-block-start: var(--af-spacing-md);
    font-size: 0.875rem;
    color: #666;
    line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 782px) {
    .altgo-controls-body {
        padding-inline: 15px;
    }
    
    .altgo-button {
        width: 100%;
        text-align: center;
    }
}

/* Bulk Generation Styles */
#altgo-bulk-generation-section {
    margin-top: 20px;
}

#altgo-bulk-progress {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
}

#altgo-bulk-progress p {
    margin: 0 0 10px 0;
    font-size: 14px;
}

#altgo-bulk-progress strong {
    font-weight: 600;
}

#altgo-bulk-stats {
    font-size: 14px;
}

#altgo-bulk-stats span {
    margin-right: 15px;
}

#altgo-bulk-log {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
}

#altgo-bulk-complete {
    margin-top: 20px;
}

#altgo-bulk-stop {
    background-color: #dc3232;
    color: white;
}

#altgo-bulk-stop:hover:not(:disabled) {
    background-color: #c92c2c;
}

#altgo-bulk-stop:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Credits cards */
.credits-cards__item {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px 28px;
    min-width: 200px;
    text-align: center;
}

.credits-cards__item--paid .credits-cards__item-value {
    color: #46b450;
}

.credits-cards__item--total {
    border-color: #0073aa;
}

.credits-cards__item-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #777;
    margin-bottom: 6px;
}

.credits-cards__item-value {
    font-size: 42px;
    font-weight: 700;
    color: #0073aa;
    line-height: 1;
    margin: 0;
}

.credits-cards__item-description {
    font-size: 13px;
    color: #999;
    margin-top: 4px;
}

.credits-cards__item-reset {
    font-size: 12px; 
    color: #aaa; 
    margin-top: 8px;
}

/* Price Grid */
.altgo-price-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
    max-width: 800px;
}

.altgo-price-grid__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background-color: var(--altgo-white);
    border: 1px solid var(--altgo-border-color);
    border-radius: 5px;
    padding: 15px;
}

.altgo-price-grid__item-title {
    margin: 0 0 5px;
    font-size: 1.25rem;
}

.altgo-price-grid__item-text {
    margin: 0;
    color: var(--altgo-grey);
    font-size: 0.9rem;
}