/*
 * Plugin Name: NTS Test Result
 * Description: Styles for the NTS Test Result frontend shortcodes.
 */

.nts-search-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 25px;
    background-color: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-family: 'Inter', sans-serif; /* Using Inter font */
    color: #333;
}

.nts-search-container h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.8em;
    font-weight: 600;
}

.nts-search-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.nts-search-form label {
    font-size: 1.1em;
    color: #555;
    font-weight: 500;
}

.nts-search-form input[type="text"] {
    width: 100%;
    max-width: 300px;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.nts-search-form input[type="text"]:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
    outline: none;
}

.nts-search-button {
    padding: 12px 25px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.05em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nts-search-button:hover {
    background-color: #005177;
    transform: translateY(-1px);
}

.nts-search-button:active {
    background-color: #003f5e;
    transform: translateY(0);
}

.nts-search-results {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.nts-search-results p {
    text-align: center;
    font-size: 1.1em;
    color: #666;
}

.nts-error-message {
    color: #d32f2f;
    font-weight: bold;
}

.nts-no-results {
    color: #f57c00;
    font-weight: bold;
}

.wp-block-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden; /* Ensures rounded corners apply to table content */
}

.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
}

.wp-block-table thead th {
    background-color: #0073aa;
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
    border-bottom: 1px solid #005177;
}

.wp-block-table tbody td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    color: #444;
    font-size: 0.9em;
}

.wp-block-table tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

.wp-block-table tbody tr:hover {
    background-color: #e9f7fe;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nts-search-container {
        padding: 15px;
        margin: 15px;
    }

    .nts-search-container h2 {
        font-size: 1.5em;
    }

    .nts-search-form input[type="text"],
    .nts-search-button {
        width: 100%;
        max-width: none;
    }

    .wp-block-table table,
    .wp-block-table thead,
    .wp-block-table tbody,
    .wp-block-table th,
    .wp-block-table td,
    .wp-block-table tr {
        display: block;
    }

    .wp-block-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .wp-block-table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        border-radius: 5px;
        overflow: hidden;
    }

    .wp-block-table td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    .wp-block-table td:before {
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: #333;
    }

    .wp-block-table td:nth-of-type(1):before { content: "Form Number"; }
    .wp-block-table td:nth-of-type(2):before { content: "Name"; }
    .wp-block-table td:nth-of-type(3):before { content: "NTS Marks"; }
    .wp-block-table td:nth-of-type(4):before { content: "Paper"; }

    .wp-block-table tbody tr:nth-child(even) {
        background-color: #f9f9f9; /* Adjust for stacked rows */
    }
}
