* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc
}

/* Nav Bar design  */
.navbar {
    background: linear-gradient(#667eea 0%, #5c72d3 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    height: 60px;
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    align-items: center;
}

.nav-brand-card,
.nav-menu-card,
.user-menu-card {
    display: flex;            /* keep contents horizontal */
    align-items: center;      /* vertically align inside each cell */
}

.nav-menu-card {
    justify-content: center;  /* center menu items in middle column */
}

/* Nav-Left: Logo/Brand */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    white-space: nowrap; /* prevent breaking */
}

/* Nav-Middle: Menu */
.nav-menu {
    display: flex;
    justify-content: center;
}

.nav-links {
    display: flex;
    gap: 150px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Nav-Right: User info */
.user-menu-card {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
}

.userName {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap; /* prevents long names from breaking layout */
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.user-profile i {
    font-size: 1.3rem;
    margin-top: 0.2rem;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.user-menu {
    position: relative;
}

.user-menu::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 8px;
    pointer-events: none;
}
.dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    display: none;
    background: white;
    color: #333;
    min-width: 170px;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    box-shadow: 0 6px 26px -4px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    animation: dropdownFade .14s ease;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-menu:hover .dropdown,
.user-menu .dropdown:hover {
    display: block;
}

.dropdown a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.45rem .65rem;
    margin: 2px 0;
    color: #1e293b;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.2;
    transition: background .15s, color .15s;
}
.dropdown a i { 
    width: 16px; text-align: center; color: #64748b; 
}

.dropdown a:hover {
    background: #f1f5f9;
    color: #2563eb;
}



* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-content h1 {
    font-size: 2rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.header-content p {
    color: #64748b;
}

.share-btn {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-btn:hover {
    background-color: #1d4ed8;
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 300px;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

.filter-select {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: white;
    min-width: 150px;
}

.results-info {
    margin-bottom: 1.5rem;
    color: #64748b;
}

.featured-section {
    margin-bottom: 2rem;
}

.featured-section h2 {
    margin-bottom: 1rem;
    color: #1e293b;
}

.featured-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: stretch;
}

.featured-flex .opportunity-card {
    flex: 1 1 calc(50% - 2rem);
    max-width: calc(50% - 2rem);
    box-sizing: border-box;
    margin-bottom: 2rem;
}

.opportunity-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    position: relative;
}

.featured-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: #f59e0b;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.opportunity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.opportunity-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.university-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #2563eb;
    margin-bottom: 0.5rem;
}

.opportunity-description {
    color: #374151;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.opportunity-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.detail-value {
    color: #1e293b;
    font-weight: 500;
}

.requirements {
    margin-bottom: 1rem;
}

.requirements h4 {
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.requirement-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.requirement-tag {
    background-color: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.opportunity-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.opportunity-poster {
    color: #64748b;
    font-size: 0.875rem;
}

.opportunity-actions {
    display: flex;
    gap: 0.5rem;
}

.save-btn, .apply-btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
}

.save-btn {
    background-color: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.apply-btn {
    background-color: #2563eb;
    color: white;
}

.type-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.phd-badge {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.masters-badge {
    background-color: #dcfce7;
    color: #16a34a;
}

.country-badge {
    background-color: #fef3c7;
    color: #d97706;
}

/* Modal styles (same as jobs page) */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    background: white;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    color: #1e293b;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn-secondary {
    background-color: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
}

.description-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.5;
    max-height: 4.5em; /* 3 lines x 1.5em */
    transition: max-height 0.3s;
    text-align: justify; /* <-- Add this line */
}

.description-text.expanded {
    -webkit-line-clamp: unset;
    max-height: none;
}

.see-more-btn {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-size: 0.95em;
    margin-top: 0.5em;
    padding: 0;
}
