* {
    font-family: 'Exo 2', Sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #1a1a1a;
    min-height: 100vh;
    color: #a8a8a8;
    display: flex;
    flex-direction: column;
}

header {
  background-color: #000000;
  padding: 16px 40px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Purple Glow Across Top */
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(147, 112, 219, 0.1) 20%, 
        rgba(147, 112, 219, 0.3) 40%,
        rgba(147, 112, 219, 0.5) 50%,
        rgba(147, 112, 219, 0.3) 60%,
        rgba(147, 112, 219, 0.1) 80%,
        transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.header-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
}

.logo-section {
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    align-items: center;
    position: relative;
    transition: all 0.4s ease;
    overflow: hidden;
    box-shadow: 0 0 0 rgba(98, 77, 227, 0); /* Start with transparent shadow */
}

.logo-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(207, 183, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    transition: none;
}

.logo-section:hover {
    box-shadow: 0 4px 8px rgba(98, 77, 227, 0.15);
}

.logo-section:hover::before {
    animation: shimmer 1.2s ease-in-out;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 150%;
    }
}

.logo {
    height: 28px;
    transition: all 0.2s;
    margin-top: 3px;
    margin-right: 4px;
}

.nav-links {
  display: flex;
  gap: 40px;
}

.nav-link {
    font-weight: 400;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #a8a8a8;
    padding: 5px 0;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: #9370db;
    visibility: hidden;
    transition: all 0.3s;
}

.nav-link:hover {
    color: #fff;
}

.nav-link:hover::before {
    visibility: visible;
    width: 100%;
}


main {
    flex-grow: 1;
    padding: 30px;
    display: flex;
    justify-content: center;
}

.content-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 30px;
    width: 100%;
}

/* Rankings Section */
.rankings-section {
    background-color: #222;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    border: 1px solid #333;
}

.rankings-header {
    background: linear-gradient(to right, rgba(4, 4, 50, 1), rgba(56, 1, 95, 1));
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rankings-header h2 {
    color: white;
    opacity: 0.9;
    font-size: 20px;
    font-weight: 600;
}

.search-container {
    display: flex;
    position: relative;
    line-height: 0;
    width: 60%;
    max-width: 500px;
}

.search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.search-input:focus {
    background-color: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
    background-color: rgba(19, 15, 63, 0.1);
}

.search-button {
    position: absolute;
    left: 15px;
    top: 50%;
    opacity: 0.8;
    transform: translateY(-50%);
    font-size: 18px;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
    padding: 0;
    margin: 0;
    z-index: 1;
}

.search-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.table-header {
    display: grid;
    grid-template-columns: 90px 1fr 180px 150px;
    padding: 15px 25px;
    background-color: #1a1a1a;
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #333;
}

.column-rank, .column-university {
    text-align: left;
}

.column-rating, .column-change {
    text-align: right;
}

/* University List */
.university-list {
    list-style: none;
}

.university-item {
    display: grid;
    grid-template-columns: 90px 1fr 180px 150px;
    align-items: center;
    padding: 16px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.university-item:hover {
    background-color: rgba(19, 15, 63, 0.1);
    transform: translateX(5px);
}

.university-item:hover::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: rgba(56, 1, 95, 1);
}

.rank-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2.5px;
}

/* Rank Styling */
.rank-change-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 7px;
    width: 24px; 
}

.rank-change-indicator img {
    width: 16px;
    height: 16px;
}

.rank-change-indicator p {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

.rank-change-indicator.up {
    color: #2dc932;
}

.rank-change-indicator.down {
    color: #e53935;
}

.rank-change-indicator.neutral {
    color: #888;
}


.rank-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.rank-number::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
}

.rank-number.gold {
    background: linear-gradient(135deg, #F5D14B, #EABC0F, #D9A420);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.rank-number.silver {
    background: linear-gradient(135deg, #E8E8E8, #C0C0C0, #A8A8A8);
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.4);
    border: 1px solid rgba(192, 192, 192, 0.3);
}

.rank-number.bronze {
    background: linear-gradient(135deg, #E0A684, #CD7F32, #A46628);
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
    border: 1px solid rgba(205, 127, 50, 0.3);
}

/* University Info */
.university-info {
    display: flex;
    align-items: center;
    gap: 15px;
    overflow: hidden;
}

.university-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid black;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.university-logo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
}

.university-details {
    display: flex;
    flex-direction: column;
}

.university-name {
    font-weight: 600;
    color: white;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 18px;
}

.rank-badge {
    height: 28px;
    width: 28px;
    margin-top: 5px;
    display: inline-block;
    vertical-align: middle;
}


.university-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #888;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-icon {
    height: 10px;
    width: 10px;
    opacity: 0.6;
    margin-top: 3px;
}

/* Rating and Rating Change */
.rating {
    text-align: right;
    font-weight: 600;
    color: white;
    font-size: 18px;
}

.rating-change {
    text-align: right;
    font-weight: 600;
    font-size: 18px;
}

.rating-change.positive {
    color: #2dc932;
}

.rating-change.negative {
    color: #e53935;
}

.rating-change.neutral {
    color: #a8a8a8;
}

/* Widgets Section */
.widgets-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Widget Styling */
.widget {
    background-color: #222;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #333;
}

.widget-header {
    background: linear-gradient(to right, rgba(11, 11, 70, 1), rgba(56, 1, 95, 1));
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget-header h3 {
    color: white;
    opacity: 0.9;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.widget-content {
    padding: 0;
}

/* Widget Legend */
.widget-legend {
    display: grid;
    grid-template-columns: 47.5px 1fr 80px;
    padding: 12px 15px;
    background-color: #1a1a1a;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    border-bottom: 1px solid #333;
}

.legend-rank, .legend-user {
    text-align: left;
}

.legend-rating {
    text-align: right;
}

/* Widget List */
.widget-list {
    list-style: none;
}

.widget-item-university {
    display: grid;
    grid-template-columns: 47.5px 1fr 80px;
    align-items: center;
    font-size: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
    cursor: pointer;
}

.widget-item-university:last-child {
    border-bottom: none;
}

.widget-item-university:hover {
    background-color: rgba(19, 15, 63, 0.1);
    transform: translateX(5px);
}

.widget-item-user {
    display: grid;
    grid-template-columns: 47.5px 1fr 80px;
    align-items: center;
    font-size: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
    cursor: pointer;
}

.widget-item-user:last-child {
    border-bottom: none;
}

.widget-item-user:hover {
    background-color: rgba(19, 15, 63, 0.1);
    transform: translateX(5px);
}

/* User Rank */
.user-rank {
    display: flex;
}

.rank-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.rank-circle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    text-decoration: none;
}


.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid black;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    color: white;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.user-avatar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    color: white;
    font-weight: 600;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    text-decoration: none;
}

.user-university, .user-count {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* User Rating */
.user-rating {
    text-align: right;
    font-weight: 600;
    font-size: 14px;
}

.user-rating.positive {
    color: #2dc932;
}

.user-rating.negative {
    color: #e53935;
}

.user-rating.neutral {
    color: #a8a8a8;
}


footer {
    background-color: #111;
    border-top: 1px solid #333;
    padding: 30px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-logo {
    font-size: 20px;
    font-weight: 600;
    background-image: linear-gradient(to right, rgb(9, 9, 154), rgba(56, 1, 95, 1));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: #a8a8a8;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.footer-links a:hover {
    color: white;
}

.footer-copyright {
    color: #666;
    font-size: 12px;
    margin-top: 10px;
}

@media (max-width: 1024px) {
    .widgets-section {
        display: none;
    }

    .content-container {
        grid-template-columns: 1fr;
    }
    
    .rankings-section {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .widgets-section {
        display: none;
    }

    .content-container {
        grid-template-columns: 1fr;
    }
    
    .rankings-section {
        width: 100%;
    }

    .table-header,
    .university-item {
        grid-template-columns: 70px minmax(0, 1fr) 120px 100px;
        padding-left: 15px;
        padding-right: 15px;
        padding-top: 22.5px;
        padding-bottom: 22.5px;
    }

    .university-name {
        max-width: 350px; /* Control the width before truncation */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block; /* Ensure it behaves as a block for proper ellipsis */
    }

    .university-info {
        overflow: hidden;
        width: 100%;
    }
    
    .rank-badge {
        display: none;
    }
    
    .search-container {
        width: 50%;
    }
}

@media (max-width: 425px) {
    /* Center the logo and navigation */
    .header-wrap {
        flex-direction: column;
        align-items: center;
        padding: 15px 0;
    }
    
    /* Add some space between logo and navigation */
    .logo-section {
        margin-bottom: 15px;
    }
    
    /* Center the navigation links */
    .nav-links {
        justify-content: center;
    }
    
    /* Table structure adjustments */
    .table-header,
    .university-item {
        grid-template-columns: 60px 1fr 100px;
        padding: 18px 10px;
    }
    
    /* Hide the Rating Δ column completely */
    .column-change,
    .university-item > *:nth-child(4) {
        display: none;
    }
    
    /* Make university logos smaller */
    .university-logo {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    /* Adjust rank size */
    .rank-number {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    
    /* Smaller university name */
    .university-name {
        font-size: 16px;
        max-width: 150px;
    }
    
    /* Hide student stats completely */
    .university-stats {
        display: none;
    }
    
    /* Make search full width and move it below title */
    .rankings-header {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 15px;
    }
    
    .search-container {
        width: 100%;
    }
    
    /* Adjust the search input size */
    .search-input {
        padding: 10px 15px 10px 40px;
        font-size: 13px;
    }

    /* Change the column header text */
    .column-rating::before,
    .contest-rating::before,
    .table-header .column-university:nth-child(3)::before,
    .table-header div:nth-child(3)::before {
        content: "RATING";
        text-align: right;
        display: block;
    }
    
    /* Hide the original "CONTEST RATING" text */
    .contest-rating,
    .column-rating,
    .table-header .column-university:nth-child(3),
    .table-header div:nth-child(3) {
        font-size: 0;
        text-align: right;
    }
    
    .contest-rating::before,
    .column-rating::before,
    .table-header .column-university:nth-child(3)::before,
    .table-header div:nth-child(3)::before {
        font-size: 12px;
    }
    
    /* Make sure all rating values are right-aligned */
    .rating,
    .university-item > *:nth-child(3) {
        text-align: right;
    }
}