/* ===================================
   LLM SOCKET WIDGET STYLES - FINAL
   =================================== */

:root {
    --primary-blue: #1B1464;
    --dark-blue: #150f50;
    --error-red: #EF4444;
    --success-green: #10B981;
    --text-gray: #6B7280;
    --light-gray: #F3F4F6;
    --border-gray: #E5E7EB;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: transparent;
    color: #1F2937;
}

/* ===================================
   WIDGET CONTAINER
   =================================== */

.widget-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.section {
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.hidden {
    display: none !important;
}

/* ===================================
   INPUT SECTION
   =================================== */

.input-section {
    text-align: center;
}

#urlInput {
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    font-family: inherit;
    border: 2px solid var(--border-gray);
    border-radius: 12px;
    outline: none;
    transition: all 0.2s;
    margin-bottom: 14px;
}

#urlInput:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(27, 20, 100, 0.1);
}

#urlInput::placeholder {
    color: #9CA3AF;
}

.primary-btn {
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.primary-btn:hover {
    background: var(--dark-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27, 20, 100, 0.3);
}

.primary-btn:active {
    transform: translateY(0);
}

.powered-by,
.powered-by-loading {
    font-size: 12px;
    color: var(--text-gray);
    text-align: center;
}

/* ===================================
   LOADING SECTION
   =================================== */

.loading-section {
    text-align: center;
    padding: 30px 16px;
}

.spinner {
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.step-indicator {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loading-message {
    font-size: 15px;
    color: var(--text-gray);
    margin-bottom: 20px;
    min-height: 22px;
}

.progress-container {
    margin-bottom: 16px;
}

.progress-bar {
    width: 100%;
    max-width: 280px;
    height: 6px;
    background: var(--border-gray);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue) 0%, #2d1b7a 100%);
    width: 0%;
    transition: width 0.5s ease;
}

/* ===================================
   PRODUCT SELECTION SECTION
   =================================== */

.selection-section {
    min-height: auto;
}

.selection-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.selection-subtitle {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 16px;
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.product-item {
    border: 2px solid var(--border-gray);
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.product-item:hover {
    border-color: var(--primary-blue);
    background: #F9FAFB;
    transform: translateY(-2px);
}

.product-name {
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 6px;
    font-size: 14px;
}

.product-url {
    font-size: 12px;
    color: var(--text-gray);
    word-break: break-all;
}

/* ===================================
   RESULTS SECTION - LABELS IN BOXES
   =================================== */

.results-section {
    min-height: auto;
    padding: 0;
}

/* Analyzed Product Display */
.analyzed-product {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-gray);
}

.analyzed-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.analyzed-url {
    font-size: 13px;
    color: var(--primary-blue);
    font-weight: 600;
    word-break: break-all;
}

/* Score Comparison - Labels Inside Boxes */
.score-comparison {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 12px;
    margin: 12px 0;
}

.score-box {
    flex: 1;
    text-align: center;
}

.score-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    margin-bottom: 8px;
}

.score-number {
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
}

.score-box.current .score-number {
    color: var(--error-red);
}

.score-box.potential .score-number {
    color: var(--success-green);
}

.score-bar {
    width: 100%;
    height: 6px;
    background: var(--light-gray);
    border-radius: 3px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    transition: width 0.6s ease;
}

.current-fill {
    background: var(--error-red);
}

.potential-fill {
    background: var(--success-green);
}

.arrow {
    font-size: 24px;
    color: var(--primary-blue);
    font-weight: 700;
}

.improvement-badge {
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--success-green);
    background: #ECFDF5;
    padding: 10px 16px;
    border-radius: 8px;
    margin: 12px 0 16px 0;
}

/* ===================================
   ISSUES SECTION
   =================================== */

.issues-section {
    background: #FEF2F2;
    border-left: 4px solid var(--error-red);
    padding: 14px 16px;
    border-radius: 8px;
    margin: 16px 0 20px 0;
}

.issues-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--error-red);
    margin-bottom: 10px;
}

.issues-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.issues-list li {
    padding: 5px 0 5px 20px;
    position: relative;
    color: #991B1B;
    font-size: 14px;
    line-height: 1.5;
}

.issues-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--error-red);
    font-weight: bold;
    font-size: 18px;
}

/* ===================================
   CTA SECTION
   =================================== */

.cta-section {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cta-primary {
    display: block;
    width: 100%;
    padding: 16px 20px;
    background: var(--primary-blue);
    color: white;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
    border: 2px solid var(--primary-blue);
}

.cta-primary:hover {
    background: var(--dark-blue);
    border-color: var(--dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(27, 20, 100, 0.3);
}

.cta-secondary {
    display: block;
    text-align: center;
    color: var(--primary-blue);
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    padding: 8px;
    transition: color 0.2s;
}

.cta-secondary:hover {
    color: var(--dark-blue);
}

.test-another-btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    background: white;
    color: var(--primary-blue);
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.test-another-btn:hover {
    border-color: var(--primary-blue);
    background: #F9FAFB;
}

/* ===================================
   ERROR SECTION
   =================================== */

.error-section {
    text-align: center;
    padding: 30px 16px;
}

.error-icon {
    font-size: 40px;
    margin-bottom: 14px;
}

.error-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--error-red);
    margin-bottom: 10px;
}

.error-message {
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 20px;
}

.secondary-btn {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    background: white;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: var(--primary-blue);
    color: white;
}

/* ===================================
   RESPONSIVE - MOBILE
   =================================== */

@media (max-width: 640px) {
    .widget-container {
        padding: 20px 14px;
    }
    
    .score-comparison {
        flex-direction: column;
        gap: 16px;
    }
    
    .arrow {
        transform: rotate(90deg);
        font-size: 20px;
    }
    
    .score-number {
        font-size: 36px;
    }
    
    .score-label {
        font-size: 10px;
    }
    
    #urlInput {
        font-size: 16px;
    }
    
    .improvement-badge {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .issues-title {
        font-size: 14px;
    }
    
    .issues-list li {
        font-size: 13px;
        padding: 4px 0 4px 18px;
    }
    
    .cta-primary {
        font-size: 14px;
        padding: 14px 18px;
    }
}

/* ===================================
   ANIMATIONS
   =================================== */

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
