* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px;
}

.hidden {
    display: none !important;
}


header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: background 0.5s ease;
}

header.logged-in {
    background: linear-gradient(135deg, #11998e, #38ef7d);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1 {
    font-size: 1.8rem;
    cursor: pointer;
    transition: opacity 0.3s;
}

h1:hover {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background 0.3s;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.2);
}

.auth-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}


main {
    min-height: calc(100vh - 120px);
    padding: 2rem 0;
}

h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

/* Search */
.search-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#search-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

#search-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s;
}

#search-btn:hover {
    transform: translateY(-2px);
}

/* Filter */
.filter-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.filter-group label {
    font-weight: 600;
    color: #333;
}

#country-filter {
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background: white;
    min-width: 200px;
    cursor: pointer;
}

#country-filter:focus {
    outline: none;
    border-color: #667eea;
}


.results-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.welcome-message {
    text-align: center;
    padding: 3rem;
    max-width: 600px;
}

.welcome-message h3 {
    color: #666;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.welcome-message p {
    color: #888;
    font-size: 1.1rem;
}

.university-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s;
    border-left: 4px solid #667eea;
    width: 80%;
    max-width: 800px;
}

.university-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.university-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.university-country {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.university-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    opacity: 0.8;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    opacity: 0.9;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}


.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #333;
}

#auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#auth-form input {
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

#auth-form input:focus {
    outline: none;
    border-color: #667eea;
}

#auth-form button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.3s;
}

#auth-form button:hover:not(:disabled) {
    transform: translateY(-2px);
}

#auth-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error-message {
    color: #dc3545;
    font-size: 0.9rem;
    text-align: center;
    padding: 0.75rem;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    margin-top: 1rem;
    display: none;
}

.error-message.show {
    display: block;
}


.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1.5rem 2rem;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    font-size: 1.1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    z-index: 10000;
    max-width: 400px;
    min-width: 300px;
    text-align: center;
    cursor: pointer;
    animation: slideUp 0.3s ease;
}

.notification.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.notification.error {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
}

.notification.info {
    background: linear-gradient(135deg, #17a2b8, #007bff);
}

@keyframes slideUp {
    0% {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}


.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


button:disabled, input:disabled, select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}


@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .university-card {
        width: 95%;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .university-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .university-actions .btn {
        margin-bottom: 0.5rem;
    }
}