/* Frontend Styles for Enhanced Google Search Bar */
/* Modern Google-like design */

.enhanced-google-search-bar {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* "Enhance By Google" Label */
.egsb-google-label {
    font-size: 11px;
    color: #70757a;
    text-align: right;
    margin-bottom: 4px;
    font-weight: 400;
    letter-spacing: 0.2px;
    text-transform: none;
}

/* Main search form */
.egsb-search-form {
    width: 100%;
}

.egsb-search-wrapper {
    position: relative;
    width: 100%;
}

.egsb-input-container {
    display: flex;
    align-items: center;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    transition: box-shadow 0.2s ease;
    overflow: hidden;
    height: 44px;
}

.egsb-input-container:hover,
.egsb-input-container:focus-within {
    box-shadow: 0 1px 8px rgba(32, 33, 36, 0.3);
}

/* Search input field */
.egsb-search-input {
    flex: 1;
    padding: 0 20px;
    border: none;
    background: transparent;
    font-size: 16px;
    line-height: 44px;
    color: #202124;
    outline: none;
    font-family: inherit;
}

.egsb-search-input::placeholder {
    color: #9aa0a6;
    opacity: 1;
}

/* Search button */
.egsb-search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #4285f4;
    height: 100%;
    min-width: 44px;
    transition: background-color 0.2s ease;
    border-left: 1px solid #dfe1e5;
}

.egsb-search-submit:hover {
    background-color: #f8f9fa;
}

.egsb-search-submit:active {
    background-color: #e8f0fe;
}

/* Search icon */
.egsb-search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.egsb-search-icon svg {
    width: 20px;
    height: 20px;
    stroke: #4285f4;
    stroke-width: 2;
}

/* Button text (if shown) */
.egsb-button-text {
    margin-left: 8px;
    font-size: 14px;
    font-weight: 500;
}

/* Full width variant */
.enhanced-google-search-bar.egsb-full-width .egsb-input-container {
    border-radius: 0;
    box-shadow: none;
    border: 1px solid #dadce0;
}

.enhanced-google-search-bar.egsb-full-width .egsb-input-container:hover {
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}

/* Results page styles */
.egsb-results-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.egsb-results-search-bar {
    max-width: 584px;
    margin: 0 auto 30px;
}

.egsb-results-title {
    color: #202124;
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
}

.egsb-results-info {
    color: #70757a;
    font-size: 14px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ebebeb;
}

/* Google Custom Search Results Styling */
.egsb-google-results {
    margin-top: 20px;
}

/* Customize Google CSE results */
.gsc-control-cse {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    font-family: inherit !important;
}

.gsc-webResult.gsc-result {
    margin-bottom: 24px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    transition: box-shadow 0.2s ease;
}

.gsc-webResult.gsc-result:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #dadce0;
}

.gs-result .gs-title,
.gs-result .gs-title * {
    color: #1a0dab !important;
    text-decoration: none !important;
    font-size: 18px !important;
    line-height: 1.3 !important;
}

.gs-result .gs-title:hover,
.gs-result .gs-title:hover * {
    text-decoration: underline !important;
}

.gs-result .gs-snippet {
    color: #4d5156 !important;
    font-size: 14px !important;
    line-height: 1.58 !important;
}

.gs-result .gs-visibleUrl {
    color: #006621 !important;
    font-size: 14px !important;
}

/* Hide Google branding */
.gsc-branding,
.gcsc-branding,
.gsc-control-cse .gsc-control-cse-en,
.gsc-control-cse .gsc-table-result {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .egsb-input-container {
        height: 40px;
        border-radius: 20px;
    }
    
    .egsb-search-input {
        font-size: 14px;
        line-height: 40px;
        padding: 0 16px;
    }
    
    .egsb-google-label {
        text-align: center;
        margin-bottom: 8px;
        font-size: 10px;
    }
    
    .egsb-results-title {
        font-size: 18px;
    }
    
    .egsb-results-search-bar {
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .egsb-input-container {
        height: 36px;
        border-radius: 18px;
    }
    
    .egsb-search-input {
        font-size: 13px;
        line-height: 36px;
        padding: 0 12px;
    }
    
    .egsb-search-submit {
        padding: 0 12px;
        min-width: 36px;
    }
    
    .egsb-search-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* Error and notice styles */
.egsb-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 4px;
    margin: 10px 0;
    border: 1px solid #f5c6cb;
    font-size: 14px;
}

.egsb-error a {
    color: #004085;
    text-decoration: underline;
}

.egsb-error a:hover {
    text-decoration: none;
}

.egsb-notice {
    background: #fff3cd;
    color: #856404;
    padding: 12px 16px;
    border-radius: 4px;
    margin: 10px 0;
    border: 1px solid #ffeaa7;
    font-size: 14px;
}