/* Form Styles */

/* Modern Input Styles */
input:not([type="radio"]), select {
    padding: 12px 16px;
    margin: 8px 0;
    width: 100%;
    max-width: 350px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

input:not([type="radio"]):focus, select:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
    outline: none;
}

input:not([type="radio"]):hover, select:hover {
    border-color: #bdbdbd;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

select:invalid {
    color: #757575;
}

select option {
    color: #333;
    padding: 12px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* Modern Add Customer Form Styles */
.form-container {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Special handling for Add Customer form to keep it narrower */
#add-customer-section .form-container {
    max-width: 500px;
}

.form-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.form-card:hover {
    transform: translateY(-4px);
}

.form-header {
    padding: 12px 24px;
    background: linear-gradient(135deg, #2E7D32 0%, #43A047 100%);
    color: white;
    margin: 0;
}

.form-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.form-subtitle {
    margin: 4px 0 0;
    opacity: 0.8;
    font-size: 14px;
}

.form-body {
    padding: 16px 24px;
    margin: 0;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: #666;
    font-size: 16px;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 10px 10px 10px 36px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.input-wrapper input:hover {
    border-color: #bdbdbd;
}

.input-wrapper input:focus {
    border-color: #2E7D32;
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.1);
    outline: none;
}

.input-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.primary-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #2E7D32;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-button:hover {
    background: #1B5E20;
    transform: translateY(-2px);
}

.primary-button:active {
    transform: translateY(0);
}

.secondary-button {
    padding: 12px 24px;
    background: #f5f5f5;
    color: #333;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-button:hover {
    background: #e0e0e0;
}

.button-icon {
    font-size: 16px;
}

#action-message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

#action-message.success {
    display: block;
    background: #E8F5E9;
    color: #1B5E20;
    border: 1px solid #A5D6A7;
}

#action-message.error {
    display: block;
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

/* Edit Customer Form */
#edit-customer-form {
    margin-bottom: 24px;
}

#edit-customer-form:not(.hidden) {
    display: block;
    animation: fadeIn 0.3s ease;
}

#edit-customer-form .input-group {
    margin-bottom: 16px;
}

#edit-customer-form .form-actions {
    margin-top: 20px;
}

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

/* Validation Styles */
.error {
    color: #dc3545;
    font-size: 13px;
    margin-top: 4px;
}

.success {
    color: green;
}

.input-error {
    border: 2px solid #ee3434;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 56, 96, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 56, 96, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 56, 96, 0);
    }
}

/* Modal Form Styles */
.modal .form-group {
    margin-bottom: 20px;
}

.modal .form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.modal .form-group .input-wrapper {
    position: relative;
    margin-bottom: 5px;
}

.modal .form-group input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.modal .form-group input:focus {
    border-color: #2E7D32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
    outline: none;
}

.modal .form-group .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #666;
    pointer-events: none;
}

.modal .form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.modal .form-group input:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .main-actions {
    display: flex;
    gap: 10px;
}

.modal-actions .danger-zone {
    margin-top: 10px;
}

.modal-actions .divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 15px 0;
}

.modal-actions .danger-text {
    color: #dc3545;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.modal-actions .danger-button {
    background: #fff;
    color: #dc3545;
    border: 2px solid #dc3545;
    padding: 8px 16px;
    border-radius: 6px;
    width: 100%;
    transition: all 0.2s ease;
}

.modal-actions .danger-button:hover {
    background: #dc3545;
    color: #fff;
}

.pay-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.3s;
}

.pay-btn:hover {
    background: #45a049;
}

/* Responsive Form Styles */
@media (max-width: 768px) {
    .form-card {
        border-radius: 0;
        box-shadow: none;
        margin: 0;
    }
    
    .form-card .form-header {
        border-radius: 0;
        padding: 16px;
    }
    
    .form-card .form-body {
        padding: 16px;
    }

    .form-group {
        margin-bottom: 20px;
    }
    
    input:not([type="radio"]), select {
        margin: 4px 0;
        border-radius: 0;
        font-size: 16px; /* Prevent iOS zoom */
        padding: 12px;
        min-height: 44px;
    }

    .modal-actions {
        flex-direction: column;
        margin-top: 15px;
        gap: 8px;
    }

    .modal-actions button {
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }
}

@media (max-width: 640px) {
    .form-container {
        margin: 1rem auto;
        padding: 0 16px;
    }

    .form-card {
        border-radius: 12px;
    }

    .form-header {
        padding: 20px 24px;
    }

    .form-header h2 {
        font-size: 20px;
    }

    .form-body {
        padding: 24px;
    }

    .input-wrapper input {
        font-size: 16px;
        padding: 10px 10px 10px 36px;
    }

    .form-actions {
        flex-direction: column;
    }

    .primary-button, .secondary-button {
        width: 100%;
        padding: 14px;
        justify-content: center;
        text-align: center;
    }

    #take-order-section select,
    #take-order-section input {
        font-size: 16px;
    }
}

/* Message styling */
.message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.message:not(:empty) {
    display: block;
}

.message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Payment Message Styling */
.payment-message {
    padding: 12px 15px;
    margin: 0 0 20px 0;
    border-radius: 4px;
    font-size: 14px;
    display: none;
    border: 1px solid;
}

.payment-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.payment-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}
