/* ============================================
   WhatsApp Food Order Plugin - Main Stylesheet
   Version: 2.0 (Fully Responsive)
   ============================================ */

/* ====================
   BASE STYLES & RESETS
   ==================== */
.wfo-order-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.wfo-order-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 25px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    color: #333333;
    line-height: 1.6;
    animation: wfo-fadeIn 0.4s ease-out forwards;
}

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

.wfo-order-container h1,
.wfo-order-container h2,
.wfo-order-container h3,
.wfo-order-container h4 {
    color: #2c3e50;
    margin-top: 0;
    line-height: 1.3;
}

.wfo-order-container h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f2f5;
    position: relative;
}

.wfo-order-container h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: #3498db;
}

.wfo-order-container h3 {
    font-size: 1.4rem;
    margin: 25px 0 15px;
    color: #3498db;
}

.wfo-order-type-notice {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 3px solid #3498db;
}

.wfo-order-type-notice strong {
    color: #2c3e50;
}


/* ====================
   FORM ELEMENTS
   ==================== */
.wfo-form-group {
    margin-bottom: 25px;
    position: relative;
}

.wfo-form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #34495e;
    font-size: 0.95rem;
}

.wfo-required {
    color: #e74c3c;
    font-weight: bold;
    margin-left: 3px;
}

.wfo-form-group input[type="text"],
.wfo-form-group input[type="number"],
.wfo-form-group textarea,
.wfo-form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e0e3e7;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background-color: #f9fafb;
    color: #2c3e50;
}

.wfo-form-group input[type="text"]:focus,
.wfo-form-group input[type="number"]:focus,
.wfo-form-group textarea:focus,
.wfo-form-group select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    outline: none;
    background-color: #ffffff;
}

.wfo-form-group textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.5;
}

/* Radio button group */
.wfo-radio-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.wfo-radio-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: normal;
    cursor: pointer;
    margin-bottom: 0;
    font-size: 1rem;
    color: #2c3e50;
    transition: color 0.2s ease;
}

.wfo-radio-group label:hover {
    color: #3498db;
}

.wfo-radio-group input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #3498db;
    cursor: pointer;
}

/* ====================
   MENU ITEMS SELECTION
   ==================== */
.wfo-menu-category {
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.wfo-menu-category h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.3rem;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e3e7;
}

.wfo-menu-items {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 15px;
}

.wfo-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid #e0e3e7;
}

.wfo-menu-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-color: #3498db;
}

.wfo-item-details {
    flex: 1;
    min-width: 0;
    padding-right: 15px;
}

.wfo-item-details h4 {
    margin: 0 0 6px 0;
    color: #2c3e50;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wfo-item-description {
    margin: 0 0 8px 0;
    color: #7f8c8d;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.wfo-item-price {
    margin: 0;
    font-weight: 600;
    color: #e67e22;
    font-size: 1rem;
}


/* Quantity Controls */
.wfo-item-quantity {
    display: flex;
    align-items: center;
    gap: 5px;
}

.wfo-qty-minus, 
.wfo-qty-plus {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 4px;
    background-color: #3498db;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.wfo-qty-minus:hover,
.wfo-qty-plus:hover {
    background-color: #2980b9;
}

.wfo-qty-minus:disabled,
.wfo-qty-plus:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.wfo-qty-input {
    width: 50px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* Selected Item Styles */
.wfo-menu-item.selected {
    background-color: #B0DFF2;
    border-left: 3px solid #3498db;
    padding-left: 12px;
    transition: all 0.3s ease;
}

.wfo-menu-item.selected .wfo-item-price {
    color: #e74c3c;
    font-weight: bold;
    margin-top: 5px;
}

/* Input focus effects */
.wfo-qty-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 1px #3498db;
}

.wfo-item-quantity input {
    width: 70px;
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #e0e3e7;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.wfo-item-quantity input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

/* ====================
   ORDER SUMMARY STYLES
   ==================== */
.wfo-order-summary {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    border: 1px solid #f0f2f5;
}

.wfo-customer-info {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f2f5;
}

.wfo-info-row {
    display: flex;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.wfo-info-label {
    font-weight: 600;
    min-width: 120px;
    color: #7f8c8d;
    font-size: 0.95rem;
}

.wfo-info-value {
    color: #2c3e50;
    flex: 1;
}

.wfo-order-items-container {
    margin: 25px 0;
    border: 1px solid #f0f2f5;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.wfo-order-item {
    padding: 18px;
    border-bottom: 1px solid #f0f2f5;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    transition: background 0.2s ease;
}

.wfo-order-item:last-child {
    border-bottom: none;
}

.wfo-order-item:hover {
    background: #f9fafb;
}

.wfo-item-name {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 1rem;
}

.wfo-item-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    flex-wrap: wrap;
    gap: 8px;
}

.wfo-item-quantity {
    color: #7f8c8d;
}

.wfo-item-price {
    color: #7f8c8d;
}

.wfo-item-total {
    font-weight: 600;
    color: #e74c3c;
}

.wfo-menu-item.selected .wfo-item-total {
    display: inline-block !important;
}

/* Order totals */
.wfo-order-totals {
    margin: 30px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #f0f2f5;
}

.wfo-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.wfo-total-row:last-child {
    margin-bottom: 0;
}

.wfo-total-label {
    color: #7f8c8d;
    font-size: 0.95rem;
}

.wfo-total-value {
    font-weight: 600;
    color: #2c3e50;
}

.wfo-grand-total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e3e7;
    font-size: 1.1rem;
}

.wfo-grand-total .wfo-total-label {
    color: #2c3e50;
    font-weight: 700;
}

.wfo-grand-total .wfo-total-value {
    color: #e74c3c;
    font-size: 1.2em;
}

/* No items message */
.wfo-no-items {
    padding: 25px;
    text-align: center;
    background: #fff8f8;
    border: 1px dashed #ffdddd;
    border-radius: 8px;
    color: #e74c3c;
    margin: 15px 0;
}

.wfo-no-items p {
    margin: 0;
    font-weight: 500;
    font-size: 1rem;
}

/* Special instructions */
.wfo-special-notes {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #f0f2f5;
}

.wfo-special-notes h3 {
    margin-bottom: 10px;
}

.wfo-special-notes p {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #3498db;
}


/* ====================
   RECEIPT STYLES
   ==================== */

.wfo-receipt {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    border: 1px solid #f0f2f5;
}

.wfo-receipt-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f2f5;
    flex-wrap: wrap;
    gap: 10px;
}

.wfo-receipt-number {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.wfo-receipt-date {
    color: #7f8c8d;
    font-size: 0.95rem;
}

.wfo-receipt-footer {
    margin-top: 30px;
    padding: 20px;
    border-top: 1px solid #f0f2f5;
    border-radius: 10px;
    text-align: center;
    background: #ffe0c7;
    color: #000;
    font-weight: 500;
    font-size: 1.1rem;
}

/* ====================
   BUTTON STYLES
   ==================== */
.wfo-form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 35px;
    gap: 15px;
    flex-wrap: wrap;
}

.wfo-button {
    padding: 14px 25px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    flex: 1;
    min-width: 160px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.wfo-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.wfo-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.wfo-button-secondary {
    background: #95a5a6;
}

.wfo-button-secondary:hover {
    background: #7f8c8d;
}

.wfo-button-whatsapp {
    background: #25D366;
}

.wfo-button-whatsapp:hover {
    background: #128C7E;
}

.wfo-confirmation-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.wfo-confirmation-actions .wfo-button {
    min-width: 200px;
}

/* Button disabled state */
.wfo-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Loading indicator */
.wfo-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: wfo-spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes wfo-spin {
    to { transform: rotate(360deg); }
}




/* WhatsApp Number Input Specific Styles */
.wfo-form-group .whatsapp-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.wfo-form-group .whatsapp-input-container::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    position: absolute;
    left: 15px;
    z-index: 2;
}

.wfo-form-group input[type="tel"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e0e3e7;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background-color: #f9fafb;
    color: #2c3e50;
}

.wfo-form-group input[type="tel"]:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    outline: none;
    background-color: #ffffff;
}

/* WhatsApp-specific description text */
.wfo-form-group .whatsapp-hint {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 8px;
    font-style: italic;
}

.wfo-form-group .whatsapp-description {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 8px;
    font-style: italic;
}

/* WhatsApp Validation States */
.wfo-form-group input.whatsapp-valid {
    border-color: #27ae60 !important;
    background-color: rgba(39, 174, 96, 0.05) !important;
}

.wfo-form-group input.whatsapp-invalid {
    border-color: #e74c3c !important;
    background-color: rgba(231, 76, 60, 0.05) !important;
}




/* ====================
   UTILITY CLASSES
   ==================== */
.wfo-hidden {
    display: none !important;
}

.wfo-text-center {
    text-align: center;
}

.wfo-text-right {
    text-align: right;
}

/* ====================
   RESPONSIVE ADJUSTMENTS
   ==================== */
@media (max-width: 768px) {
    .wfo-order-container {
        padding: 20px;
        margin: 15px;
        border-radius: 8px;
    }
    
    .wfo-admin-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .wfo-form-actions,
    .wfo-confirmation-actions {
        flex-direction: column;
    }
    
    .wfo-button {
        width: 100%;
    }
    
    .wfo-info-row {
        flex-direction: row !important; /* Override flex-direction column */
        align-items: center;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .wfo-info-label {
        min-width: 120px !important; /* Beri lebar minimum untuk konsistensi */
        text-align: left;
        margin-bottom: 0 !important;
    }

    .wfo-info-value {
        flex: 1;
        text-align: left;
    }
    
    .wfo-item-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .wfo-item-total {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px dashed #eee;
        width: 100%;
        text-align: right;
    }
    
    .wfo-menu-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .wfo-item-quantity input {
        width: 100%;
    }
    
    /* Perbesar tombol quantity di mobile */
    .wfo-qty-minus, 
    .wfo-qty-plus {
        width: 90px;
        height: 50px;
        font-size: 20px;
    }
    
    .wfo-qty-input {
        width: 60px;
        font-size: 18px;
        padding: 8px;
    }
    
    .wfo-item-quantity {
        gap: 8px;
    }


}

@media (max-width: 480px) {
    .wfo-order-container {
        padding: 15px;
        margin: 10px;
    }
    
    .wfo-order-container h2 {
        font-size: 1.5rem;
    }
    
    .wfo-radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .wfo-receipt-header {
        flex-direction: column;
    }
    
    .wfo-receipt-date {
        margin-top: 5px;
    }
    
    .wfo-confirmation-actions .wfo-button {
        min-width: 100%;
    }
    
    /* Perbesar lagi untuk layar sangat kecil */
    .wfo-qty-minus, 
    .wfo-qty-plus {
        width: 90px;
        height: 50px;
    }
    
    .wfo-qty-input {
        width: 70px;
    }
    
    .wfo-info-label {
        min-width: 100px !important;
        font-size: 0.9rem;
    }
        
    .wfo-info-value {
        font-size: 0.95rem;
    }

    .wfo-form-group .whatsapp-input-container::before {
        width: 20px;
        height: 20px;
        left: 12px;
    }
    
    .wfo-form-group input[type="tel"] {
        padding-left: 40px !important;
    }
    
    .wfo-form-group input[type="tel"] {
        padding: 12px 14px;
    }
    
    .wfo-form-group .whatsapp-hint {
        font-size: 0.8rem;
    }
    
}

/* ====================
   DARK MODE SUPPORT
   ==================== */
@media (prefers-color-scheme: dark) {
    .wfo-order-container,
    .wfo-order-summary,
    .wfo-menu-item,
    .wfo-receipt,
    .wfo-admin-col {
        background: #2d3748;
        color: #e2e8f0;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        border-color: #4a5568;
    }
    
    .wfo-order-container h2,
    .wfo-order-container h3,
    .wfo-order-container h4,
    .wfo-item-name,
    .wfo-info-value,
    .wfo-receipt-number,
    .wfo-total-value {
        color: #f7fafc;
    }
    
    .wfo-form-group input[type="text"],
    .wfo-form-group input[type="number"],
    .wfo-form-group textarea,
    .wfo-form-group select {
        background: #4a5568;
        border-color: #4a5568;
        color: #f7fafc;
    }
    
    .wfo-menu-category,
    .wfo-order-totals {
        background: #1a202c;
        border-color: #2d3748;
    }
    
    .wfo-item-description,
    .wfo-info-label,
    .wfo-total-label,
    .wfo-receipt-date,
    .wfo-item-quantity,
    .wfo-item-price {
        color: #a0aec0;
    }
    
    .wfo-order-items-container,
    .wfo-menu-item {
        border-color: #4a5568;
    }
    
    .wfo-no-items {
        background: #2d2525;
        border-color: #5c3a3a;
        color: #ff9e9e;
    }
    
    .wfo-special-notes p {
        background: #1a202c;
        border-left-color: #3498db;
    }

    .wfo-form-group input.whatsapp-valid {
        border-color: #2ecc71 !important;
        background-color: rgba(46, 204, 113, 0.1) !important;
    }
    
    .wfo-form-group input.whatsapp-invalid {
        border-color: #e74c3c !important;
        background-color: rgba(231, 76, 60, 0.1) !important;
    }
    
    .wfo-form-group .whatsapp-description {
        color: #a0aec0;
    }
    
    .wfo-form-group input[type="tel"] {
        background: #4a5568;
        border-color: #4a5568;
        color: #f7fafc;
    }
    
    .wfo-form-group .whatsapp-hint {
        color: #a0aec0;
    }
}