/**
 * Grocery Price Comparison Tool Styles
 * Brand Color: #ff1716
 */

.gpct-container {
    max-width: 600px;
    margin: 30px auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.gpct-header {
    background: #ff1716;
    color: #ffffff;
    padding: 25px 20px;
    text-align: center;
}

.gpct-header h1 {
    margin: 0 0 8px 0;
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.3;
}

.gpct-header p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.95;
}

.gpct-tabs {
    display: flex;
    background: #f8f8f8;
    border-bottom: 2px solid #e0e0e0;
}

.gpct-tab {
    flex: 1;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    user-select: none;
}

.gpct-tab:hover {
    background: #ffffff;
    color: #ff1716;
}

.gpct-tab.gpct-tab-active {
    background: #ffffff;
    color: #ff1716;
    border-bottom-color: #ff1716;
}

.gpct-tab-content {
    display: none;
    padding: 25px;
}

.gpct-tab-content.gpct-tab-active {
    display: block;
}

.gpct-section-title {
    color: #ff1716;
    font-size: 1.1rem;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.gpct-product-group {
    background: #fafafa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e8e8e8;
    position: relative;
}

.gpct-product-label {
    font-weight: 600;
    color: #444;
    margin-bottom: 10px;
    display: block;
}

.gpct-remove-product {
    float: right;
    background: #ff1716;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.3s ease;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
}

.gpct-remove-product:hover {
    background: #cc0000;
    transform: scale(1.1);
}

.gpct-remove-product:active {
    transform: scale(0.95);
}


.gpct-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: stretch;
}

.gpct-input-row input[type="number"],
.gpct-input-row select,
.gpct-currency-select {
    padding: 5px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.gpct-input-row input[type="number"]:focus,
.gpct-input-row select:focus,
.gpct-currency-select:focus {
    border-color: #ff1716;
    outline: none;
}

/* Fixed: Better width distribution for input fields */
.gpct-input-row input[type="number"]:first-child {
    flex: 0 1 40%;
    min-width: 80px;
}

.gpct-input-row input[type="number"]:nth-child(2) {
    flex: 0 1 40%;
    min-width: 80px;
}

.gpct-input-row select {
    flex: 0 0 20%;
    min-width: 70px;
    max-width: 90px;
}

.gpct-currency-select {
    width: 100%;
    margin-bottom: 15px;
}

.gpct-btn,
.gpct-btn-secondary {
    width: 100%;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.gpct-btn {
    background: #ff1716;
    color: #ffffff;
}

.gpct-btn:hover {
    background: #e01515;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 23, 22, 0.3);
}

.gpct-btn:active {
    transform: translateY(0);
}

.gpct-btn-secondary {
    background: #ffffff;
    color: #ff1716;
    border: 2px solid #ff1716;
    margin-top: 5px;
}

.gpct-btn-secondary:hover {
    background: #fff5f5;
}

.gpct-results {
    margin-top: 20px;
    padding: 20px;
    background: #f0fff0;
    border-radius: 8px;
    border: 2px solid #4caf50;
    display: none;
}

.gpct-results.gpct-show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gpct-results h3 {
    color: #ff1716;
    margin-top: 0;
    margin-bottom: 15px;
}

.gpct-result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.gpct-result-table th,
.gpct-result-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.gpct-result-table th {
    background: #ffe7e7;
    color: #b30000;
    font-weight: 600;
}

.gpct-best-deal {
    background: #ff1716 !important;
    color: #ffffff !important;
    font-weight: bold;
}

.gpct-savings {
    color: #4caf50;
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 10px;
}

.gpct-calculation-box {
    background: #fff9e6;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    display: none;
}

.gpct-calculation-box.gpct-show {
    display: block;
    animation: slideDown 0.3s ease;
}

.gpct-calc-result {
    font-size: 1.3rem;
    color: #ff1716;
    font-weight: bold;
    margin: 10px 0;
}

.gpct-info-text {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 600px) {
    .gpct-container {
        margin: 15px 10px;
    }
    
    .gpct-header h1 {
        font-size: 1.4rem;
    }
    
    .gpct-tab {
        padding: 12px 5px;
        font-size: 0.9rem;
    }
    
    .gpct-tab-content {
        padding: 15px;
    }
    
    /* Adjust input sizes for mobile */
    .gpct-input-row input[type="number"]:first-child,
    .gpct-input-row input[type="number"]:nth-child(2) {
        flex: 1 1 35%;
        min-width: 70px;
    }
    
    .gpct-input-row select {
        flex: 0 0 30%;
        min-width: 60px;
        max-width: 80px;
    }
    
    .gpct-result-table th,
    .gpct-result-table td {
        padding: 8px 5px;
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .gpct-input-row {
        gap: 5px;
    }
    
    .gpct-input-row input[type="number"],
    .gpct-input-row select {
        padding: 8px 6px;
        font-size: 0.9rem;
    }
}
