/**
 * Google Font Selector Styles
 * Clean, minimal CSS for modern implementation
 */

/* Select2 Container Layouts */
.select2.selectGFont {
    width: calc(100% - 190px) !important;
}

.select2.selectGFontVariante {
    width: 190px !important;
}

/* Font Dropdown Styles */
.select2-container.selectGFont .select2-results .select2-results__options {
    min-height: 300px;
    max-height: 70vh;
}

.select2-container.selectGFont .select2-results .select2-results__option {
    font-size: 1.8em;
    color: #333;
    height: 56px;
    line-height: 56px;
    overflow: hidden;
    position: relative;
    padding: 0 40px 0 12px;
}

.select2-container.selectGFont .select2-results__option--highlighted {
    background-color: #007bff;
    color: #fff;
}

/* Variant Dropdown Styles */
.select2-container.selectGFontVariante .select2-results .select2-results__option {
    font-size: 1.3em;
    height: 42px;
    line-height: 42px;
    overflow: hidden;
    padding: 0 12px;
}

/* Font Category Display */
.select2FontName {
    position: absolute;
    font-size: 11px;
    top: 2px;
    right: 8px;
    color: #6c757d;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.select2-container.selectGFont .select2-results__option--highlighted .select2FontName {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

.select2.selectGFont .select2-selection__rendered .select2FontName {
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
}

/* Loading States */
.font-loading {
    opacity: 0.6;
    pointer-events: none;
}

.font-loading .select2-selection {
    background: #f8f9fa;
}

/* Border Radius for Connected Selects */
.select2.selectGFont .select2-selection {
    border-radius: 6px 0 0 6px !important;
}

.select2.selectGFont.select2-container--open .select2-selection {
    border-radius: 6px 0 0 0 !important;
}

.select2.selectGFontVariante .select2-selection {
    border-radius: 0 6px 6px 0 !important;
    border-left: 0 !important;
}

.select2.selectGFontVariante.select2-container--open .select2-selection {
    border-radius: 0 6px 0 0 !important;
}

/* Error States */
.font-selector-error .select2-selection {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Success States */
.font-selector-success .select2-selection {
    border-color: #28a745 !important;
}

/* Focus States */
.select2-container--focus .select2-selection {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Preview Styles */
.preview {
    transition: font-family 0.3s ease, font-weight 0.3s ease, font-style 0.3s ease;
    min-height: 60px;
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

/* Ensure h3 inside preview inherits font properties */
.preview h3 {
    font-weight: inherit !important;
    font-style: inherit !important;
    font-family: inherit !important;
    margin: 0;
}

/* Loading Spinner */
#fontLoadingSpinner {
    width: 1rem;
    height: 1rem;
}

#fontLoadingText {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .select2.selectGFont {
        width: calc(100% - 150px) !important;
    }
    
    .select2.selectGFontVariante {
        width: 150px !important;
    }
    
    .select2-container.selectGFont .select2-results .select2-results__option {
        font-size: 1.5em;
        height: 48px;
        line-height: 48px;
    }
    
    .select2FontName {
        font-size: 10px;
        right: 6px;
    }
}

@media (max-width: 576px) {
    .select2.selectGFont {
        width: calc(100% - 120px) !important;
    }
    
    .select2.selectGFontVariante {
        width: 120px !important;
    }
    
    .select2-container.selectGFont .select2-results .select2-results__option {
        font-size: 1.3em;
        height: 44px;
        line-height: 44px;
        padding-right: 30px;
    }
    
    .select2FontName {
        display: none; /* Hide category on very small screens */
    }
    
    .preview {
        font-size: 1.1rem;
        padding: 12px;
    }
}

@media (max-width: 320px) {
    .select2.selectGFont {
        width: calc(100% - 100px) !important;
    }
    
    .select2.selectGFontVariante {
        width: 100px !important;
    }
    
    .select2-container.selectGFontVariante .select2-results .select2-results__option {
        font-size: 1.1em;
        height: 38px;
        line-height: 38px;
        padding: 0 8px;
    }
}