* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    position: relative;
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

header p {
    color: #718096;
}

#language-selector {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 100;
}

.language-btn {
    background: white;
    color: #4299e1;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.language-btn:hover {
    background-color: #e2e8f0;
}

.language-btn.active {
    background-color: #4299e1;
    color: white;
    border-color: #4299e1;
}

.search-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    flex-direction: column;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.option-group {
    display: flex;
    flex-direction: row;
    gap: .5rem 1rem;
    flex-wrap: wrap;
}

.spec-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.group-title {
  margin: 0;
  flex-grow: 1;
}

.select-all-checkbox {
  margin: 0;
  width: auto;
}

.select-all-label {
  font-weight: normal;
  margin-bottom: 0;
}

.spec-field-group {
  margin-bottom: 1.5rem;
}

.spec-title-wrapper:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.label-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.toggle-button {
    background: none;
    border: none;
    color: #4299e1;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    border-radius: 4px;
}

.toggle-button:hover {
    background-color: rgba(66, 153, 225, 0.1);
}

.toggle-icon {
    transition: transform 0.2s ease;
}

.toggle-button[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.togglable-group {
    max-height: 99999px;
    overflow-y: auto;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}

.togglable-group.collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
}

.option-item {
    display: flex;
    flex-direction: row;
    gap: .5rem;
    align-items: baseline;
}

.option-item label {
    text-wrap: nowrap;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4a5568;
}

input[type="checkbox"], input[type="checkbox"] + label {
    cursor: pointer;
}

input, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background-color: white;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.5em;
    padding-right: 2.5rem;
}

input:focus, select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

button {
    background-color: #4299e1;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    align-self: flex-end;
}

button:hover {
    background-color: #3182ce;
}

.results-section {
    display: grid;
    gap: 1.5rem;
}

#results-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.programs-container {
    display: flex;
    flex-direction: column;
    padding: .5rem;
    gap: .5rem;
}

.program-card {
    background: white;
    padding: .5rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.program-card p {
    margin: 0;
}

.university-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.social-icons {
    display: flex;
    gap: 0.5rem;
}

.social-icon {
    height: 20px;
}

.university-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding-bottom: 0.5rem;
  }
  
  .toggle-card-btn {
    background: none;
    border: none;
    color: #4299e1;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
  }
  
  .toggle-card-btn:hover {
    background-color: rgba(66, 153, 225, 0.1);
  }
  
  .toggle-card-btn .toggle-icon {
    transition: transform 0.2s ease;
  }
  
  .toggle-card-btn[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
  }
  
  .university-content {
    max-height: 2000px;
    opacity: 1;
    transition: max-height 0.5s ease, opacity 0.3s ease 0.1s;
    overflow: hidden;
  }
  
  .university-content.collapsed {
    max-height: 0;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.3s ease;
    overflow: hidden;
  }
  
  .university-header h2 {
    margin: 0;
    flex-grow: 1;
    cursor: pointer;
  }

.university-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.university-card h2 {
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.university-card p {
    color: #718096;
    margin-bottom: 1rem;
}

.description {
    font-style: italic;
    color: #4a5568;
    margin-bottom: 1.5rem;
}

.programs, .degrees {
    margin-bottom: 1.5rem;
}

.programs h3, .degrees h3 {
    color: #4a5568;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.programs ul, .degrees ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.programs li, .degrees li {
    background-color: #edf2f7;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: #4a5568;
}

.contact-info {
    background-color: #f7fafc;
    padding: 1rem;
    border-radius: 6px;
}

.contact-info h3 {
    color: #4a5568;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.contact-info p {
    margin-bottom: 0.5rem;
}

.contact-info a {
    color: #4299e1;
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

.error {
    color: #e53e3e;
    text-align: center;
    padding: 1rem;
    background-color: #fff5f5;
    border-radius: 6px;
    margin: 1rem 0;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .filters {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    button {
        width: 100%;
    }

    .university-card {
        padding: 1rem;
    }
}

#scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #4299e1;
    color: white;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
    padding: 0;
}

#scroll-to-top:hover {
    background-color: #3182ce;
}

#scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    #scroll-to-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 20px;
    }
}