/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

body {
    background: #f0f4f8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
}

.container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 900px;
    padding: 40px;
    text-align: center;
}

.page-title {
    color: #1a2a6c;
    margin-bottom: 40px;
    font-size: 2.5rem;
    font-weight: 600;
}

/* Search Box */
.search-box {
    display: flex;
    margin-bottom: 30px;
    position: relative;
}

.search-box input {
    flex: 1;
    padding: 18px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 50px 0 0 50px;
    font-size: 16px;
    outline: none;
    transition: 0.3s;
    background: white;
}

.search-box input:focus {
    border-color: #1a2a6c;
}

.search-box button {
    background: #1a2a6c;
    color: white;
    border: none;
    padding: 0 35px;
    border-radius: 0 50px 50px 0;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}

.search-box button:hover {
    background: #0e1a42;
}

/* Results Area */
.results {
    margin-top: 30px;
    text-align: left;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Scrollbar */
.results::-webkit-scrollbar {
    width: 6px;
}

.results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.results::-webkit-scrollbar-thumb {
    background: #aaa;
    border-radius: 10px;
}

.results::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Group Item Card */
.group-item {
    background: #f9f9fc;
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 20px;
    border-left: 5px solid #1a2a6c;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: 0.2s;
}

.group-item:hover {
    background: #f0f2fa;
}

.group-name {
    font-weight: 600;
    color: #1a2a6c;
    margin-bottom: 12px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-name i {
    color: #b21f1f;
    font-size: 1.6rem;
}

.models-list {
    color: #333;
    line-height: 1.7;
    padding-left: 20px;
    font-size: 1rem;
    white-space: pre-line;
}

/* No Results */
.no-results {
    text-align: center;
    color: #777;
    padding: 50px 20px;
    background: #fafafa;
    border-radius: 12px;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #b21f1f;
}

/* Loading Spinner */
.loading {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top-color: #1a2a6c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Highlighted Search Term */
.search-term {
    background-color: #d4edda;
    color: #155724;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* Exact Match Item */
.exact-match {
    border-left-color: #28a745;
    background: #f3fcf3;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-icon {
    width: 70px;
    height: 70px;
    background: #1a2a6c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 28px;
}

.modal h3 {
    font-size: 1.8rem;
    color: #222;
    margin-bottom: 10px;
}

.modal p {
    color: #555;
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
    cursor: pointer;
    border: none;
    font-size: 15px;
}

.modal-btn-login {
    background: #1a2a6c;
    color: white;
}

.modal-btn-register {
    background: #28a745;
    color: white;
}

.modal-btn-cancel {
    background: #e0e0e0;
    color: #333;
}

.modal-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid #1a2a6c;
    max-width: 350px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 📱 Mobile Responsive Fix */
@media screen and (max-width: 600px) {
    .search-box {
        flex-direction: column;
        gap: 10px;
    }

    .search-box input {
        border-radius: 50px;
        padding: 16px 20px;
        width: 100%;
    }

    .search-box button {
        border-radius: 50px;
        padding: 16px 20px;
        width: 100%;
        justify-content: center;
    }

    .page-title {
        font-size: 2rem;
    }

    .container {
        padding: 30px 20px;
    }

    .group-name {
        font-size: 1.3rem;
    }

    .models-list {
        font-size: 0.95rem;
        padding-left: 10px;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
        text-align: center;
    }
}

/* 📱 Extra Small Devices */
@media screen and (max-width: 400px) {
    .page-title {
        font-size: 1.6rem;
    }

    .search-box input,
    .search-box button {
        padding: 14px 16px;
        font-size: 15px;
    }

    .group-item {
        padding: 18px;
    }
}