/**
 * UPS Prepaid Label - Shipment Form Styles
 * 
 * Modern, soft UI design for the shipping label form
 * 
 * @package UPS_Prepaid_Label
 */

:root {
    --wc-primary: #720eec;
    --wc-green: #7ad03a;
    --wc-red: #a00;
    --wc-orange: #ffba00;
    --wc-blue: #2ea2cc;
}

/* Colors below use CSS vars set by Form Look & Feel in admin (on .ups-prepaid-label-form-wrapper) */

.ups-prepaid-label-form-wrapper {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.ups-ship-to-info {
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
    border: none;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: none;
}

.ups-ship-to-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--ups-border, #000000);
}

.ups-ship-to-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--ups-border, #000000);
}

.ups-ship-to-content {
    display: flex;
    align-items: center;
    gap: 30px;
}

.ups-ship-to-message {
    flex-shrink: 0;
    margin: 0;
    font-size: 15px;
    color: #000000;
    font-weight: 500;
}

.ups-ship-to-address {
    flex: 1;
    background: #ffffff;
    padding: 20px 25px;
    border-radius: 12px;
    border: 2px solid var(--ups-border, #000000);
    box-shadow: none;
}

.ups-ship-to-name {
    font-size: 18px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 8px;
}

.ups-ship-to-line {
    font-size: 15px;
    color: var(--ups-border, #000000);
    line-height: 1.6;
    font-weight: 500;
}

.ups-modern-header {
    text-align: left;
    margin-bottom: 40px;
    padding: 40px 40px;
    background: var(--ups-header-bg, #ffffff);
    border-radius: 0px;
    color: var(--ups-header-text, #000000);
    box-shadow: none;
}

.ups-modern-header h2 {
    margin: 0 0 40px 0;
    font-size: 45px;
    font-weight: 600;
    text-shadow: none;
}

.ups-modern-header p {
    margin: 0;
    font-size: 16px;
    opacity: 1;
}

.ups-shipment-form {
    background: #ffffff;
    border-radius: 0px;
    box-shadow: none;
    overflow: hidden;
}

.ups-form-section {
    padding: 40px;
    border-bottom: 1px solid #f0f0f0;
}

.ups-form-section:last-of-type {
    border-bottom: none;
}

.ups-form-section h3 {
    margin: 0 0 30px 0;
    font-size: 24px;
    font-weight: 600;
    color: #000000;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: none;
}

.ups-form-row {
    margin-bottom: 25px;
}

.ups-form-row label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #000000;
    font-size: 14px;
}

.ups-form-row label .required {
    color: #e53e3e;
    margin-left: 3px;
}

.ups-form-row input[type="text"],
.ups-form-row input[type="email"],
.ups-form-row input[type="tel"],
.ups-form-row input[type="number"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #000000;
}

.ups-form-row input[type="tel"] {
   font-size: 14px;
    color: #000000;
    padding: 4px;
    border: 1px solid #b6b6b6;
    background: #ffffff;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
}

.ups-form-row input:focus {
    outline: none;
    border-color: var(--ups-accent, #aea494);
    background: #ffffff;
    box-shadow: none;
    transform: translateY(-1px);
}

.ups-form-row-halves {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ups-form-row-quarters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

/* Multi-Package Styles */
.ups-packages-header {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.ups-packages-header h3 {
    margin: 0;
    padding: 0;
    border: none;
}

.ups-add-package-btn {
    background: #aea494;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none;
    text-transform: uppercase;
}

.ups-add-package-btn:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.ups-packages-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ups-package-item {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s ease;
}

.ups-package-item:hover {
    border-color: var(--ups-accent, #aea494);
    box-shadow: none;
}

.ups-package-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.ups-package-number {
    font-size: 18px;
    font-weight: 700;
    color: #000000;
}

.ups-remove-package {
    background: #aea494;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.ups-remove-package:hover {
    background: #aea494;
    transform: scale(1.05);
}

.ups-form-actions {
    padding: 30px 40px;
    text-align: center;
    background: #ffffff;
}

.ups-get-rates-btn {
    background: var(--ups-button-bg, #000000) !important;
    color: var(--ups-header-text, #ffffff) !important;
    padding: 18px 50px !important;
    border: none !important;
    border-radius: 0px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.ups-get-rates-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--ups-button-bg, #000000);
    transition: left 0.5s;
}

.ups-get-rates-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: none;
}

.ups-get-rates-btn:hover::before {
    left: 100%;
}

.ups-get-rates-btn:active {
    transform: translateY(0) !important;
}

.ups-get-rates-btn:disabled {
    background: var(--ups-button-bg, #000000);
    cursor: not-allowed !important;
    box-shadow: none !important;
}

.ups-rates-container {
    margin-top: 30px;
    padding: 40px;
    background: linear-gradient(to bottom, #fafbfc, #ffffff);
    border-radius: 20px;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ups-rates-container h3 {
    margin: 0 0 25px 0;
    font-size: 24px;
    font-weight: 600;
    color: #000000;
    text-align: center;
}

.ups-rates-list {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.ups-rate-item {
    background: #ffffff;
    border: 3px solid #e2e8f0;
    border-radius: 16px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.ups-rate-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: #aea494;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ups-rate-item:hover {
    border-color: var(--ups-accent, #aea494);
    box-shadow: none;
    transform: translateX(5px);
}

.ups-rate-item:hover::before {
    opacity: 1;
}

.ups-rate-item.selected {
    border-color: var(--ups-accent, #aea494);
    background: linear-gradient(135deg, #fcfbfe 0%, #f3f0ff 100%);
    box-shadow: none;
}

.ups-rate-item.selected::before {
    opacity: 1;
}

.ups-rate-item-info {
    flex: 1;
    padding-left: 10px;
}

.ups-rate-item-name {
    font-weight: 600;
    font-size: 18px;
    color: #000000;
    margin-bottom: 5px;
}

.ups-rate-item-code {
    font-size: 13px;
    color: #aea494;
    font-weight: 500;
}

.ups-rate-item-price-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ups-rate-item-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--ups-primary, #aea494);
    white-space: nowrap;
}

.ups-rate-item-currency {
    font-size: 14px;
    color: #aea494;
    margin-left: 3px;
}

.ups-rate-item-select {
    padding: 12px 28px;
    background: #aea494;
    color: #ffffff;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ups-rate-item-select:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.ups-rate-item-select:active {
    transform: translateY(0);
}

.ups-form-messages {
    margin-top: 25px;
}

.ups-message {
    padding: 18px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    font-size: 15px;
    animation: slideDown 0.3s ease;
    box-shadow: none;
}

.ups-message::before {
    font-size: 24px;
    margin-right: 15px;
}

.ups-message.error {
    background: ffffff;
    color: #000000;
    border-left: 5px solid #e53e3e;
}

.ups-message.error::before {
    content: "⚠️";
}

.ups-message.success {
    background: ffffff;
    color: #000000;
    border-left: 5px solid #38a169;
}

.ups-message.success::before {
    content: "✓";
}

.ups-message.info {
    background: ffffff;
    color: #000000;
    border-left: 5px solid #aea494;
}

.ups-message.info::before {
    content: "ℹ️";
}

.ups-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ups-rate-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: #000000;
    color: #ffffff;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ups-rate-badge::before {
    content: "⚡";
    margin-right: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ups-prepaid-label-form-wrapper {
        padding: 10px;
        margin: 20px auto;
    }
    
    .ups-ship-to-info {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .ups-ship-to-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .ups-ship-to-address {
        width: 100%;
        padding: 15px 20px;
    }
    
    .ups-modern-header {
        padding: 30px 15px;
    }
    
    .ups-modern-header h2 {
        font-size: 28px;
    }
    
    .ups-form-section {
        padding: 25px 20px;
    }
    
    .ups-form-row-halves,
    .ups-form-row-quarters {
        grid-template-columns: 1fr;
    }
    
    .ups-rate-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .ups-rate-item-price-section {
        width: 100%;
        justify-content: space-between;
    }
    
    .ups-rate-item-select {
        width: 100%;
        text-align: center;
    }
    
    .ups-form-actions {
        padding: 20px;
    }
    
    .ups-get-rates-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .ups-modern-header h2 {
        font-size: 24px;
    }
    
    .ups-form-section h3 {
        font-size: 20px;
    }
    
    .ups-rate-item-name {
        font-size: 16px;
    }
    
    .ups-rate-item-price {
        font-size: 24px;
    }
}
