/**
 * CarbonGuru URL Submission Widget Styles
 *
 * Follows CarbonGuru brand guidelines with CG Orange accents
 * Aligned with content-paste widget styling
 */

/* Widget Container */
.cg-url-submission-widget {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Widget Header */
.cg-widget-header {
    margin-bottom: 1.5rem;
}

.cg-widget-header h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.5rem 0;
}

.cg-widget-description {
    font-size: 1rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Input Section */
.cg-input-section {
    margin-bottom: 1.5rem;
}

.cg-url-input {
    width: 100%;
    padding: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: #1a1a1a;
    background: #f9f9f9;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.cg-url-input:focus {
    outline: none;
    border-color: var(--wp--preset--color--cg-green-600, #067F38);
    background: #ffffff;
}

.cg-url-input::placeholder {
    color: #999;
}

/* URL Validation Feedback */
.cg-url-validation {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    min-height: 1.25rem;
}

.cg-url-validation.cg-valid {
    color: #4caf50; /* Green for valid */
}

.cg-url-validation.cg-invalid {
    color: #d32f2f; /* Red for invalid */
}

/* Widget Actions */
.cg-widget-actions {
    display: flex;
    justify-content: flex-end;
}

.cg-submit-url {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--wp--preset--color--cg-white, #ffffff);
    background: var(--wp--preset--color--cg-green-600, #067F38);
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cg-submit-url:hover:not(:disabled) {
    background: var(--wp--preset--color--cg-green-300, #63BFA2);
}

.cg-submit-url:active:not(:disabled) {
    background: var(--wp--preset--color--cg-green-700, #056830);
}

.cg-submit-url:disabled {
    background: var(--wp--preset--color--cg-neutral-400, #A8B0B9);
    cursor: not-allowed;
}

/* Progress Container */
.cg-progress-container {
    margin-top: 2rem;
    padding: 2rem;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
}

.cg-progress-header {
    margin-bottom: 1.5rem;
}

.cg-progress-header h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.5rem 0;
}

.cg-progress-text {
    font-size: 1rem;
    color: #666;
    margin: 0;
}

.cg-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.cg-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--wp--preset--color--cg-green-600, #067F38), var(--wp--preset--color--cg-green-700, #056830));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Result Container */
.cg-result-container {
    margin-top: 2rem;
    padding: 2rem;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Duplicate Notice */
.cg-duplicate-notice {
    text-align: center;
}

.cg-duplicate-notice h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.5rem 0;
}

.cg-duplicate-info {
    font-size: 1rem;
    color: #666;
    margin: 0 0 1.5rem 0;
}

.cg-duplicate-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.cg-duplicate-actions .wp-element-button {
    min-width: 200px;
}

/* Success Result */
.cg-success-result {
    text-align: center;
}

.cg-result-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1.5rem 0;
}

/* Item Row (inline format like content-paste widget) */
.cg-item-row {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.cg-item-row:last-child {
    border-bottom: none;
}

.cg-item-link {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem;
    color: var(--wp--preset--color--cg-blue-700, #1A4A73);
    text-decoration: none;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.cg-item-link:hover {
    color: var(--wp--preset--color--cg-blue-500, #3A7CA5);
    text-decoration: underline;
}

.cg-item-link:hover .cg-item-name {
    color: var(--wp--preset--color--cg-blue-500, #3A7CA5);
}

.cg-item-name {
    font-weight: 500;
}

.cg-item-price {
    color: #1a1a1a;
}

.cg-item-separator {
    color: #999;
    margin: 0 0.125rem;
}

.cg-item-carbon {
    color: var(--wp--preset--color--cg-green-600, #067F38);
    font-weight: 500;
}

.cg-item-description {
    color: #666;
    font-size: 0.875rem;
    line-height: 1.4;
}

.cg-item-naics {
    color: #666;
    font-size: 0.85rem;
}

/* Result Summary (same as content-paste) */
.cg-result-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.cg-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #ffffff;
    border-radius: 6px;
}

.cg-result-label {
    font-weight: 500;
    color: #666;
}

.cg-result-value {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 1.125rem;
}

.cg-result-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.cg-result-actions-secondary {
    margin-bottom: 0;
}

/* View Results Link - styled as link per theme guidelines */
.cg-view-results-btn {
    color: var(--wp--preset--color--cg-blue-700, #1A4A73);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
}

.cg-view-results-btn:hover {
    color: var(--wp--preset--color--cg-blue-500, #3A7CA5);
    text-decoration: underline;
}

/* Error Result */
.cg-error-result {
    text-align: center;
}

.cg-error-result h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #d32f2f;
    margin: 0 0 0.5rem 0;
}

.cg-error-message {
    font-size: 1rem;
    color: #666;
    margin: 0 0 1.5rem 0;
}

/* Button Styles - Following CG Theme Guidelines */
.wp-element-button {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: var(--wp--preset--color--cg-white, #ffffff);
    background: var(--wp--preset--color--cg-green-600, #067F38);
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.wp-element-button:hover {
    background: var(--wp--preset--color--cg-green-300, #63BFA2);
    color: var(--wp--preset--color--cg-white, #ffffff);
}

.wp-element-button:active {
    background: var(--wp--preset--color--cg-green-700, #056830);
}

.cg-button-secondary {
    background: var(--wp--preset--color--cg-neutral-600, #4A5568);
}

.cg-button-secondary:hover {
    background: var(--wp--preset--color--cg-neutral-500, #6B7785);
}

/* Examples Section */
.cg-examples {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--wp--preset--color--cg-green-050, #E6F5EC);
    border-radius: 6px;
    border-left: 4px solid var(--wp--preset--color--cg-green-600, #067F38);
}

.cg-examples h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cg-examples ul {
    margin: 0;
    padding-left: 1.5rem;
}

.cg-examples li {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.cg-examples code {
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    color: #1a1a1a;
    background: #ffffff;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cg-url-submission-widget {
        padding: 1.5rem;
        margin: 1rem auto;
    }

    .cg-widget-header h3 {
        font-size: 1.5rem;
    }

    .cg-url-input {
        font-size: 0.9375rem;
    }

    .cg-result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .cg-duplicate-actions {
        width: 100%;
    }

    .cg-duplicate-actions .wp-element-button,
    .wp-element-button {
        width: 100%;
        min-width: auto;
    }
}
