/**
 * ShipEngine Frontend Styles
 * File: assets/css/frontend.css
 */

.shipengine-form-container {
    /* max-width: 800px; */

    background: #fff;

}

.shipengine-form-container h3 {
    margin: 0 0 20px 0;
    padding: 0 0 10px 0;
    border-bottom: 2px solid #0073aa;
    color: #333;
    font-size: 24px;
}

.shipengine-form {
    display: flex;
    flex-direction: column;
}

.form-section {
    background: #fff;
    margin: 20px 0;
}

.form-section h4 {
    margin: 0 0 15px 0;
    color: #0b5b85 ;
    font-size: 18px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.select{
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 15px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.shipengine-form input,
.shipengine-form select,
.shipengine-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.shipengine-form input:focus,
.shipengine-form select:focus,
.shipengine-form textarea:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
    outline: none;
}

.shipengine-form input[type="number"] {
    text-align: right;
}

.shipengine-form textarea {
    resize: vertical;
    min-height: 80px;
}

.shipengine-submit-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    align-self: flex-start;
}

.shipengine-submit-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.shipengine-submit-btn:active {
    transform: translateY(0);
}

.shipengine-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.shipengine-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    font-size: 14px;
}

.shipengine-result .success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
}

.shipengine-result .error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
}

.shipengine-result .success p,
.shipengine-result .error p {
    margin: 0 0 10px 0;
}

.shipengine-result .success p:last-child,
.shipengine-result .error p:last-child {
    margin-bottom: 0;
}

.shipengine-result a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

.shipengine-result a:hover {
    text-decoration: underline;
}

/* Loading states */
.shipengine-form.loading {
    opacity: 0.7;
    pointer-events: none;
}

.shipengine-form.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
   
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
   
    .shipengine-submit-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
 
    

    
    .shipengine-form input,
    .shipengine-form select,
    .shipengine-form textarea {
        padding: 10px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Rate comparison styles */
.rates-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.rate-option {
    background: #fff;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rate-option:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0,115,170,0.2);
}

.rate-option.selected {
    border-color: #0073aa;
    background: #f0f8ff;
}

.rate-carrier {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.rate-service {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.rate-price {
    font-size: 24px;
    font-weight: 700;
    color: #0073aa;
}

.rate-delivery {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* Tracking result styles */
.tracking-info {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    margin-top: 20px;
}

.tracking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.tracking-status {
    font-size: 18px;
    font-weight: 600;
    color: #0073aa;
}

.tracking-carrier {
    color: #666;
    font-size: 14px;
}

.tracking-events {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tracking-event {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.tracking-event:last-child {
    border-bottom: none;
}

.event-description {
    flex: 1;
    margin-right: 15px;
}

.event-location {
    color: #666;
    font-size: 12px;
    margin-top: 3px;
}

.event-date {
    color: #999;
    font-size: 12px;
    white-space: nowrap;
}


/* Success form styling */
.shipengine-form.form-success {
    border: 2px solid #28a745;
    background-color: #f8fff9;
    border-radius: 8px;
    padding: 20px;
    position: relative;
}

.shipengine-form.form-success::before {
    content: "✓";
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background-color: #28a745;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
}

/* Download section styling */
.shipengine-downloads {
    margin-top: 20px;
    padding: 20px;
    background-color: #f0f8ff;
    border-radius: 6px;
    border-left: 4px solid #007cba;
}

.shipengine-downloads h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

/* Download buttons container */
.download-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Download button base styles */
.download-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    color: white;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

/* PDF button */
.pdf-btn {
    background-color: #dc3545;
}

.pdf-btn:hover {
    background-color: #c82333;
}

/* PNG button */
.png-btn {
    background-color: #28a745;
    display: none;
}

.png-btn:hover {
    background-color: #218838;
}


/* ZPL button */
.zpl-btn {
    background-color: #28a745;
}

.zpl-btn:hover {
    background-color: #218838;
}

/* Add icons to download buttons (optional - if you have Font Awesome or similar) */
.pdf-btn::before {
    content: "📄";
    margin-right: 8px;
}

.png-btn::before {
    content: "🖼️";
    margin-right: 8px;
}

.zpl-btn::before {
    content: "📋";
    margin-right: 8px;
}

/* Success result message styling */
.shipengine-result.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
}

.shipengine-result.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .download-buttons {
        flex-direction: column;
    }
    
    .download-btn {
        width: 100%;
        justify-content: center;
    }
}