/* Main Layout */
#ggg-admin-container {
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 30px;
    margin-top: 20px;
}

.ggg-controls-section {
    grid-column: 1;
}

.ggg-result-section {
    grid-column: 2;
}

/* Cards */
.ggg-controls-section,
.ggg-result-section {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
}

/* Form */
.ggg-form-group {
    margin-bottom: 25px;
}

.ggg-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: #1d2327;
}

.ggg-form-group input[type="text"],
.ggg-form-group input[type="url"],
.ggg-form-group select {
    width: 100%;
    max-width: 100%;
    padding: 8px 12px;
}

/* URL Wrapper */
.ggg-url-wrapper {
    display: flex;
    align-items: stretch;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.ggg-url-prefix {
    background: #f0f0f1;
    padding: 8px 12px;
    border-right: 1px solid #8c8f94;
    color: #50575e;
    font-size: 14px;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.ggg-slug-input {
    flex: 1;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 8px 12px !important;
    margin: 0 !important;
}

/* Action Buttons */
.ggg-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
}

.ggg-action-buttons .button {
    justify-content: center;
}

/* Replace Option */
.ggg-replace-option {
    margin-left: 25px;
    padding-left: 15px;
    border-left: 3px solid #2271b1;
    background: #f0f6fc;
    padding: 15px;
    border-radius: 4px;
}

.ggg-current-attachment {
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.ggg-current-attachment strong {
    color: #2271b1;
}

/* Info Box */
.ggg-info-box {
    margin-top: 30px;
    padding: 20px;
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
}

.ggg-info-box h3 {
    margin-top: 0;
    color: #1d2327;
}

.ggg-info-box ol {
    margin: 10px 0;
    padding-left: 20px;
}

.ggg-info-box li {
    margin: 8px 0;
    color: #50575e;
}

/* Results */
.ggg-result-placeholder {
    padding: 30px;
    border: 2px dashed #ddd;
    border-radius: 6px;
    background: #f8f9fa;
}

.ggg-result-placeholder p {
    margin: 15px 0;
    font-size: 15px;
    color: #50575e;
}

.ggg-result-placeholder p strong {
    color: #2271b1;
}

/* Notifications */
.ggg-notification {
    position: fixed;
    top: 32px;
    right: -400px;
    z-index: 999999;
    background: #fff;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.2);
    min-width: 300px;
    max-width: 400px;
    transition: right 0.3s ease;
}

.ggg-notification.show {
    right: 20px;
}

.ggg-notification-success {
    border-left: 4px solid #46b450;
}

.ggg-notification-error {
    border-left: 4px solid #dc3232;
}

/* Description */
.description {
    color: #646970;
    font-size: 13px;
    margin: 5px 0 0 0;
}

/* ============================================
   FRONTEND CAPTURE BUTTON - IMPROVED UI
   ============================================ */

.ggg-capture-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99999;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    background: black !important;
    color: white;
    border: none;
    padding: 16px 28px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ggg-capture-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.ggg-capture-btn:active {
    transform: translateY(-1px);
}

.ggg-capture-btn:disabled {
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.ggg-capture-btn.loading {
    pointer-events: none;
}

.ggg-btn-icon {
    font-size: 20px;
    line-height: 1;
}

.ggg-btn-text {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Button Spinner */
.ggg-spinner-icon {
    width: 20px;
    height: 20px;
}

.ggg-spinner-svg {
    animation: ggg-rotate 2s linear infinite;
    width: 20px;
    height: 20px;
}

.ggg-spinner-path {
    stroke: white;
    stroke-linecap: round;
    animation: ggg-dash 1.5s ease-in-out infinite;
}

@keyframes ggg-rotate {
    100% { transform: rotate(360deg); }
}

@keyframes ggg-dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* ============================================
   SETTINGS PANEL - MODERN UI
   ============================================ */

.ggg-settings-panel {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 99998;
    background: white;
    border: none;
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    min-width: 300px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    backdrop-filter: blur(10px);
}

.ggg-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    background: black;
    color: white;
    cursor: pointer;
    user-select: none;
}

.ggg-panel-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: white !important;
}

.ggg-panel-toggle {
    /* background: rgba(255,255,255,0.2) !important; */
    background: rgba(255,255,255,0.3) !important;
    border: none;
    color: white;
    width: 32px !important;
    height: 32px !important;
    border-radius: 100% !important;
    border-radius: 10px !important;
    cursor: pointer;
    font-size: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    /* padding: 0px !important; */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* border: solid red 6px !important; */
}

.ggg-panel-toggle:hover {
    background: rgba(255,255,255,0.35);
    transform: scale(1.1);
}

.ggg-panel-content {
    padding: 24px;
}

.ggg-setting-option {
    margin-bottom: 18px;
}

.ggg-checkbox-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    cursor: pointer;
    padding: 12px 14px;
    border-radius: 12px;
    transition: all 0.2s;
    background: #f8fafc;
    border: 2px solid transparent;
}

.ggg-checkbox-label:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}

.ggg-checkbox-label.ggg-sub-checkbox {
    padding-left: 46px;
    font-size: 13px;
    margin-left: 8px;
    background: #f1f5f9;
}

.ggg-checkbox-label.ggg-sub-checkbox:hover {
    background: #e0e7ff;
}

.ggg-checkbox-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin: 0;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #667eea;
    border-radius: 6px;
    flex-shrink: 0;
}

.ggg-checkbox-text {
    flex: 1;
}

.ggg-attachment-info {
    margin-top: 14px;
    margin-left: 38px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-radius: 10px;
    font-size: 13px;
    color: #4c1d95;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid #667eea;
}

.ggg-info-icon {
    font-size: 18px;
}

.ggg-attachment-info strong {
    color: #5b21b6;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    font-weight: 700;
    font-size: 14px;
}

.ggg-replace-option {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    background: transparent;
}

/* ============================================
   RESULTS PANEL - ENHANCED MODERN UI
   ============================================ */

.ggg-results-panel {
    position: fixed;
    top: 50%;
    right: -480px;
    transform: translateY(-50%);
    z-index: 99999;
    background: white;
    border-radius: 24px 0 0 24px;
    box-shadow: -8px 0 40px rgba(0,0,0,0.15);
    width: 450px;
    max-height: 92vh;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: right 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ggg-results-panel.visible {
    right: 0;
}

.ggg-results-panel::-webkit-scrollbar {
    width: 8px;
}

.ggg-results-panel::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.ggg-results-panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.ggg-results-panel::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.ggg-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    background: black;
    color: white;
    border-radius: 24px 0 0 0;
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ggg-results-header h4 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: white !important;
}

.ggg-results-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ggg-results-close:hover {
    background: rgba(255,255,255,0.35);
    /* transform: rotate(90deg) scale(1.1); */
}

.ggg-results-content {
    padding: 28px;
}

.ggg-results-placeholder {
    text-align: center;
    padding: 80px 40px;
}

.ggg-placeholder-icon {
    font-size: 72px;
    margin-bottom: 20px;
    opacity: 0.25;
    filter: grayscale(100%);
}

.ggg-results-placeholder p {
    color: #64748b;
    font-size: 15px;
    margin: 0;
    font-weight: 500;
}

/* Result Status - Enhanced */
.ggg-result-status {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    border: 2px solid;
}

.ggg-result-status.success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #6ee7b7;
}

.ggg-result-status.info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
}

.ggg-status-icon {
    font-size: 32px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.ggg-status-text {
    flex: 1;
}

.ggg-status-text strong {
    display: block;
    font-size: 17px;
    margin-bottom: 8px;
    color: #0f172a;
    font-weight: 700;
}

.ggg-status-text p {
    margin: 0;
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
}

.ggg-status-text code {
    background: rgba(0,0,0,0.08);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    font-size: 13px;
    color: #1e293b;
    font-weight: 700;
}

/* Cache Notice - Enhanced */
.ggg-cache-notice {
    padding: 24px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    border-radius: 16px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.ggg-notice-icon {
    font-size: 28px;
    margin-bottom: 12px;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.ggg-notice-text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 10px;
    color: #78350f;
    font-weight: 700;
}

.ggg-notice-text p {
    margin: 0;
    font-size: 14px;
    color: #92400e;
    line-height: 1.7;
}

/* Cache Timer - Enhanced */
.ggg-cache-timer {
    margin-top: 20px;
}

.ggg-timer-bar {
    width: 100%;
    height: 10px;
    background: rgba(0,0,0,0.12);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.ggg-timer-progress {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
    border-radius: 10px;
    transition: width 1s linear;
    width: 0%;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.ggg-timer-text {
    font-size: 13px;
    color: #92400e;
    font-weight: 700;
    text-align: center;
}

.ggg-timer-text span {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    font-size: 14px;
    background: rgba(0,0,0,0.08);
    padding: 2px 8px;
    border-radius: 6px;
}

/* Result Actions - Enhanced */
.ggg-result-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ggg-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.ggg-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.ggg-action-btn:hover::before {
    left: 100%;
}

.ggg-download-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.ggg-download-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.45);
}

.ggg-download-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.ggg-download-btn:disabled {
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ggg-media-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.ggg-media-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.45);
}

.ggg-media-btn:active {
    transform: translateY(-1px);
}

.ggg-action-icon {
    font-size: 20px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

/* Small Spinner - Enhanced */
.ggg-spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: ggg-spin 0.6s linear infinite;
}

/* Toast Notifications - Enhanced */
.ggg-toast {
    position: fixed;
    top: 100px;
    right: -420px;
    z-index: 999999;
    background: white;
    padding: 18px 28px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    font-weight: 600;
    transition: right 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 380px;
    backdrop-filter: blur(10px);
}

.ggg-toast.show {
    right: 40px;
}

.ggg-toast-success {
    border-left: 5px solid #10b981;
    color: #065f46;
    background: linear-gradient(135deg, #ecfdf5 0%, white 100%);
}

.ggg-toast-error {
    border-left: 5px solid #ef4444;
    color: #7f1d1d;
    background: linear-gradient(135deg, #fef2f2 0%, white 100%);
}

/* Responsive */
@media (max-width: 1400px) {
    #ggg-admin-container {
        grid-template-columns: 450px 1fr;
    }
}

@media (max-width: 1200px) {
    #ggg-admin-container {
        grid-template-columns: 1fr;
    }
    
    .ggg-controls-section,
    .ggg-result-section {
        grid-column: 1;
    }
}

@media (max-width: 782px) {
    .ggg-url-wrapper {
        flex-direction: column;
    }
    
    .ggg-url-prefix {
        border-right: none;
        border-bottom: 1px solid #8c8f94;
    }
    
    .ggg-capture-btn {
        bottom: 20px;
        right: 20px;
        padding: 14px 22px;
        font-size: 14px;
    }
    
    .ggg-settings-panel {
        /* bottom: 20px;
        left: 20px;
        right: 20px;
        min-width: auto; */
    }
    
    .ggg-results-panel {
        width: 100%;
        right: -100%;
        border-radius: 16px 16px 0 0;
        top: auto;
        bottom: 0;
        transform: none;
        max-height: 80vh;
    }
    
    .ggg-results-panel.visible {
        right: 0;
    }
    
    .ggg-toast {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .ggg-toast.show {
        right: 20px;
    }
}

/* Force better rendering */
* {
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

.elementor-invisible {
    visibility: visible !important;
    opacity: 1 !important;
}

img[data-src],
img[data-lazy-src] {
    opacity: 1 !important;
    visibility: visible !important;
}