/* App-Style Widget System for OneSource.Ug */
/* Modern, clean design that emulates native app components */

/* Global Google Translate Styling for all pages */
#google_translate_element {
    margin: 15px;
    text-align: center;
}

#google_translate_element .goog-te-combo {
    padding: 8px 12px;
    border: 2px solid #0066c0;
    border-radius: 8px;
    background: white;
    color: #0066c0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 102, 192, 0.1);
    min-width: 160px;
}

#google_translate_element .goog-te-combo:hover {
    border-color: #0056a3;
    box-shadow: 0 4px 16px rgba(0, 102, 192, 0.2);
    transform: translateY(-2px);
}

#google_translate_element .goog-te-combo:focus {
    outline: none;
    border-color: #0066c0;
    box-shadow: 0 0 0 3px rgba(0, 102, 192, 0.15);
}

#google_translate_element .goog-te-menu2 {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
    background: white !important;
    padding: 8px 0 !important;
    margin-top: 8px !important;
}

#google_translate_element .goog-te-menu2-item {
    padding: 10px 16px !important;
    color: #232f3e !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    border: none !important;
    background: transparent !important;
}

#google_translate_element .goog-te-menu2-item:hover {
    background: #f8f9fa !important;
    color: #0066c0 !important;
}

:root {
    --widget-bg: #ffffff;
    --widget-border: #e1e5e9;
    --widget-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --widget-radius: 12px;
    --primary-color: #0066c0;
    --secondary-color: #ff9900;
    --success-color: #00a650;
    --danger-color: #e31c25;
    --text-primary: #0f1111;
    --text-secondary: #565959;
    --text-muted: #767676;
    --hover-bg: #f8f9fa;
    --active-bg: #e3f2fd;
}

/* Widget Container */
.app-widget {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    background: var(--widget-bg);
    border: 1px solid var(--widget-border);
    border-radius: var(--widget-radius);
    box-shadow: var(--widget-shadow);
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Floating Show Button */
.widget-show-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: var(--widget-shadow);
    z-index: 99999;
    transition: all 0.3s ease;
}

/* Language Status Indicator on Floating Button */
.widget-show-button::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #00a650;
    border: 2px solid white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.widget-show-button:hover {
    background: #0056a3;
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.app-widget:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Widget Header */
.widget-header {
    background: linear-gradient(135deg, var(--primary-color), #0056a3);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
}

.widget-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.widget-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-minimize,
.widget-close {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.widget-minimize:hover,
.widget-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Widget Content */
.widget-content {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

/* Currency Section */
.currency-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--primary-color);
}

/* Currency Selector */
.currency-selector {
    position: relative;
    margin-bottom: 16px;
}

.currency-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--hover-bg);
    border: 1px solid var(--widget-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.currency-display:hover {
    background: var(--active-bg);
    border-color: var(--primary-color);
}

.currency-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.currency-symbol {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.currency-code {
    font-size: 14px;
    color: var(--text-secondary);
}

.currency-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--widget-bg);
    border: 1px solid var(--widget-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.currency-option {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--widget-border);
}

.currency-option:last-child {
    border-bottom: none;
}

.currency-option:hover {
    background: var(--hover-bg);
}

.currency-option.active {
    background: var(--active-bg);
    color: var(--primary-color);
}

/* Language Section */
.language-section {
    margin-bottom: 24px;
}

.language-selector {
    position: relative;
    margin-bottom: 16px;
}

.language-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--hover-bg);
    border: 1px solid var(--widget-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-display:hover {
    background: var(--active-bg);
    border-color: var(--primary-color);
}

.language-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.language-flag {
    font-size: 18px;
}

.language-code {
    font-size: 14px;
    color: var(--text-secondary);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--widget-bg);
    border: 1px solid var(--widget-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.language-option {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--widget-border);
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: var(--hover-bg);
}

.language-option.active {
    background: var(--active-bg);
    color: var(--primary-color);
}

/* Google Translate Container within Widget */
.google-translate-container {
    margin-bottom: 16px;
    padding: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.google-translate-container #google_translate_element {
    margin: 0;
}

/* Style Google Translate within the widget */
.google-translate-container .goog-te-gadget {
    font-family: inherit;
    font-size: 13px;
}

.google-translate-container .goog-te-combo {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    background: white;
    font-size: 13px;
    font-weight: 500;
    color: #232f3e;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.google-translate-container .goog-te-combo:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 102, 192, 0.15);
}

.google-translate-container .goog-te-combo:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 192, 0.1);
}

/* Google Translate dropdown within widget */
.google-translate-container .goog-te-menu2 {
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    background: white !important;
    padding: 6px 0 !important;
    margin-top: 4px !important;
}

.google-translate-container .goog-te-container .goog-te-menu2-item {
    padding: 8px 12px !important;
    color: #232f3e !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    border: none !important;
    background: transparent !important;
}

.google-translate-container .goog-te-menu2-item:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%) !important;
    color: var(--primary-color) !important;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.action-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
}

.action-btn.primary:hover {
    background: #0056a3;
    transform: translateY(-1px);
}

.action-btn.secondary {
    background: var(--secondary-color);
    color: white;
}

.action-btn.secondary:hover {
    background: #e68a00;
    transform: translateY(-1px);
}

.action-btn.outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.action-btn.outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Status Indicators */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--hover-bg);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
}

.status-dot.warning {
    background: var(--secondary-color);
}

.status-dot.error {
    background: var(--danger-color);
}

/* Widget Footer */
.widget-footer {
    padding: 16px 20px;
    background: var(--hover-bg);
    border-top: 1px solid var(--widget-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.widget-version {
    font-weight: 500;
}

.widget-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Minimized State */
.app-widget.minimized {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
}

.app-widget.minimized .widget-content,
.app-widget.minimized .widget-footer {
    display: none;
}

.app-widget.minimized .widget-header {
    padding: 18px;
    justify-content: center;
}

.app-widget.minimized .widget-title {
    display: none;
}

.app-widget.minimized .widget-controls {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-widget {
        position: fixed;
        top: auto;
        bottom: 20px;
        right: 20px;
        width: 280px;
    }
    
    .app-widget.minimized {
        width: 50px;
        height: 50px;
    }
}

/* Animation Classes */
.widget-fade-in {
    animation: widgetFadeIn 0.3s ease-out;
}

.widget-fade-out {
    animation: widgetFadeOut 0.3s ease-out;
}

@keyframes widgetFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes widgetFadeOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

/* Custom Scrollbar */
.widget-content::-webkit-scrollbar {
    width: 6px;
}

.widget-content::-webkit-scrollbar-track {
    background: var(--hover-bg);
    border-radius: 3px;
}

.widget-content::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

.widget-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}


