* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    background-image: url("https://cdn.prod.website-files.com/65fabbf8f7f7323a634a308c/668255350d9613fbf365a440_marvin-meyer-SYTO3xs06fU-unsplash.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
}

/* Navigation Styles */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.welcome-text {
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.logout-btn {
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #c82333;
}

/* Form Container Styles */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-toggle {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.form-toggle button {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: color 0.3s;
}

.form-toggle button.active {
    border-bottom: 2px solid #1a73e8;
    color: #1a73e8;
    font-weight: 600;
}

form {
    display: none;
}

form.active {
    display: block;
}

/* Input Styles */
input {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #1a73e8;
}

/* Button Styles */
button {
    width: 100%;
    padding: 12px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s;
}

button:hover {
    background: #1557b0;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Search Section Styles */
.search-section,
.saved-section {
    background: white;
    padding: 30px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-section h3,
.saved-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 22px;
}

.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
}

#searchInput {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    min-width: 300px;
    margin: 0;
}

.search-button {
    width: auto;
    padding: 12px 24px;
    margin: 0;
}

/* University Card Styles */
.university-card {
    background: white;
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e0e0e0;
}

.university-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.university-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 18px;
}

.university-card p {
    color: #666;
    margin: 5px 0;
    line-height: 1.6;
}

.university-card a {
    display: inline-block;
    color: #2196F3;
    text-decoration: none;
    margin: 10px 0;
    padding: 8px 16px;
    background: #e3f2fd;
    border-radius: 4px;
    transition: background 0.3s;
    font-size: 14px;
}

.university-card a:hover {
    background: #bbdefb;
    text-decoration: none;
}

/* Save and Remove Button Styles */
.save-btn,
.remove-btn {
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    margin-right: 10px;
    width: auto;
    transition: opacity 0.3s, background 0.3s;
}

.save-btn {
    background: #4CAF50;
}

.save-btn:hover {
    background: #45a049;
    opacity: 0.9;
}

.remove-btn {
    background: #f44336;
}

.remove-btn:hover {
    background: #da190b;
    opacity: 0.9;
}

/* Results and Saved List */
#results,
#savedList {
    margin-top: 20px;
}

#results:empty::before {
    content: "Search for universities to see results here";
    display: block;
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

#savedList:empty::before {
    content: "No saved universities yet";
    display: block;
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

/* Error Message Styles */
.error {
    color: #f44336;
    padding: 12px;
    margin: 10px 0;
    background: #ffebee;
    border-radius: 4px;
    border: 1px solid #ffcdd2;
    font-size: 14px;
}

/* Success Message Styles */
.success {
    color: #4CAF50;
    padding: 12px;
    margin: 10px 0;
    background: #e8f5e9;
    border-radius: 4px;
    border: 1px solid #a5d6a7;
    font-size: 14px;
}

/* Info Message Styles */
.info {
    color: #2196F3;
    padding: 12px;
    margin: 10px 0;
    background: #e3f2fd;
    border-radius: 4px;
    border: 1px solid #bbdefb;
    font-size: 14px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 16px;
}

.loading::after {
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: ".";
    }
    40% {
        content: "..";
    }
    60%, 100% {
        content: "...";
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state p {
    font-size: 16px;
    margin: 10px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 20px auto;
        padding: 10px;
    }

    nav {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .search-container {
        flex-direction: column;
    }

    #searchInput {
        min-width: 100%;
    }

    .university-card {
        padding: 15px;
    }

    .university-card h3 {
        font-size: 16px;
    }

    .welcome-text {
        font-size: 18px;
    }

    .search-section,
    .saved-section {
        padding: 20px;
    }

    .save-btn,
    .remove-btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px;
        margin: 10px auto;
    }

    .search-section,
    .saved-section {
        padding: 15px;
    }

    .form-toggle button {
        font-size: 14px;
        padding: 10px;
    }

    nav {
        padding: 15px;
    }

    .logout-btn {
        width: 100%;
        text-align: center;
    }

    .university-card {
        padding: 12px;
    }

    button {
        font-size: 14px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}