/* Frontend Styles for EchBay XWatch Customer Lookup */

.xwatch-lookup-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.xwatch-lookup-title {
    color: #2c3e50;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.5em;
    font-weight: 600;
}

/* Form Styling */
.xwatch-lookup-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 6px;
    margin-bottom: 25px;
}

.xwatch-form-group {
    margin-bottom: 20px;
}

.xwatch-form-group:last-child {
    margin-bottom: 0;
}

.xwatch-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.xwatch-phone-input {
    width: 96%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.xwatch-phone-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.xwatch-phone-input:invalid {
    border-color: #e74c3c;
}

.xwatch-help-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #7f8c8d;
    font-style: italic;
}

.xwatch-submit-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.xwatch-submit-btn:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.xwatch-submit-btn:active {
    transform: translateY(0);
}

/* Messages */
.xwatch-message {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 5px;
    font-weight: 500;
}

.xwatch-error {
    background: #fdf2f2;
    color: #e74c3c;
    border-left: 4px solid #e74c3c;
}

.xwatch-lookup-error {
    background: #fdf2f2;
    color: #e74c3c;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
}

.xwatch-lookup-error p {
    margin: 0;
    font-weight: 500;
}

/* Results Table */
.xwatch-results {
    margin-top: 30px;
}

.xwatch-results h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.xwatch-results-table {
    overflow-x: auto;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.xwatch-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.xwatch-table thead {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.xwatch-table thead th {
    color: white;
    font-weight: 600;
    padding: 15px 12px;
    text-align: left;
    border: none;
    font-size: 14px;
}

.xwatch-table tbody tr {
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s ease;
}

.xwatch-table tbody tr:hover {
    background-color: #f8f9fa;
}

.xwatch-table tbody tr:last-child {
    border-bottom: none;
}

.xwatch-table td {
    padding: 15px 12px;
    border: none;
    color: #2c3e50;
    font-size: 14px;
}

.xwatch-table td:first-child {
    font-weight: 600;
    color: #3498db;
}

/* Responsive Design */
@media (max-width: 768px) {
    .xwatch-lookup-container {
        margin: 10px;
        padding: 15px;
        border-radius: 6px;
    }

    .xwatch-lookup-form {
        padding: 20px 15px;
    }

    .xwatch-lookup-title {
        font-size: 1.3em;
        margin-bottom: 20px;
    }

    .xwatch-phone-input {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .xwatch-submit-btn {
        width: 100%;
        padding: 14px 20px;
    }

    /* Responsive table */
    .xwatch-results-table {
        border-radius: 4px;
    }

    .xwatch-table {
        font-size: 13px;
    }

    .xwatch-table thead {
        display: none;
    }

    .xwatch-table tbody tr {
        display: block;
        margin-bottom: 15px;
        background: #fff;
        border: 1px solid #e1e5e9;
        border-radius: 6px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .xwatch-table tbody tr:hover {
        background: #fff;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    .xwatch-table td {
        display: block;
        padding: 8px 0;
        border: none;
        text-align: left;
    }

    .xwatch-table td:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #3498db;
        display: inline-block;
        width: 120px;
        margin-right: 10px;
    }

    .xwatch-table td:first-child:before {
        content: "STT: ";
    }
}

@media (max-width: 480px) {
    .xwatch-lookup-container {
        margin: 5px;
        padding: 12px;
    }

    .xwatch-lookup-form {
        padding: 15px 10px;
    }

    .xwatch-table td:before {
        width: 100px;
    }
}

/* Loading State */
.xwatch-lookup-form.loading .xwatch-submit-btn {
    position: relative;
    color: transparent;
}

.xwatch-lookup-form.loading .xwatch-submit-btn:after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Print Styles */
@media print {
    .xwatch-lookup-form {
        display: none;
    }

    .xwatch-lookup-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .xwatch-table thead {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
    }

    .xwatch-table thead th {
        color: #000 !important;
        -webkit-print-color-adjust: exact;
    }
}