/**
 * Student Search Plugin Styles
 * Theme-agnostic design that inherits theme styles.
 */

/* Container */
.student-search-container {
    max-width: 100%;
    margin: 2rem 0;
    font-family: inherit;
    color: inherit;
}

/* Search Box */
.student-search-box {
    margin-bottom: 2rem;
}

/* Title */
.student-search-title {
    margin: 0 0 1rem 0;
    color: inherit;
    line-height: 1.2;
}

/* Search Form - Flex Layout */
.student-search-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: stretch;
}

/* Input Field - Inherit Theme defaults as much as possible */
.student-search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    /* Fallback if theme doesn't style inputs */
    font-size: 1rem;
    font-family: inherit;
    /* We try to rely on theme's input[type="text"] styling */
    /* If theme needs help, we add basic border */
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.5);
    /* Semi-transparent */
    color: inherit;
    border-radius: 4px;
    /* Soft default */
}

/* Search Button - Mimic Theme Buttons */
.student-search-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;

    /* Try to use WordPress standard Customizer colors if available */
    background-color: var(--wp--preset--color--primary, #333);
    color: var(--wp--preset--color--white, #fff);
    border: none;
    border-radius: 4px;
    transition: opacity 0.2s;
}

.student-search-btn:hover {
    opacity: 0.9;
}

.student-search-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loader */
.spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    opacity: 0.7;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Result Container - Minimalist */
.student-result {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: transparent;
}

/* Status Borders */
.student-result.success {
    border-color: #4caf50;
    border-left-width: 4px;
}

.student-result.error {
    border-color: #f44336;
    border-left-width: 4px;
}

.student-result h3 {
    margin-top: 0;
    color: inherit;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* Info Grid */
.student-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.info-item {
    padding: 0;
    /* Remove card look to blend better */
    background: transparent;
    border: none;
    box-shadow: none;
}

.info-label {
    display: block;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 1.1em;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 600px) {
    .student-search-form {
        flex-direction: column;
    }

    .student-search-btn {
        width: 100%;
    }
}