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

html, body {
    height: 100%;
    overflow-x: hidden;
}

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

.container {
    max-width: 100%;
    margin: 25px 15px;
    padding: 25px;
    background-color: #1a1d23;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

main {
    padding: 0;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: #4a90e2;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-buttons {
    display: flex;
    gap: 16px;
    align-items: center;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #4a90e2;
}

.nav-link.active {
    color: #4a90e2;
    background-color: rgba(74, 144, 226, 0.1);
}

.problems-btn {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.problems-btn:hover {
    background: linear-gradient(135deg, #357abd 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.install-btn {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 10px;
    margin-left: 12px;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.install-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #357abd 0%, #2563eb 100%);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.install-btn:hover .install-icon {
    transform: none;
}

.install-icon {
    font-size: 16px;
    color: white;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Notification button in navigation */
.notification-button {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 10px;
    margin-left: 12px;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.notification-button:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #357abd 0%, #2563eb 100%);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.problems-nav-btn {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-left: 15px;
}

.problems-nav-btn:hover {
    background: linear-gradient(135deg, #357abd 0%, #2c5f96 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* Removed redundant button styles as they're now defined in the class styles */

#notificationBtn.clicked {
    opacity: 0.8;
    transition: opacity 0.1s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Removed problematic shake animation */

/* Add a subtle fade transition for the disabled state */
@keyframes fadeToDefault {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

.notification-icon {
    font-size: 18px;
    line-height: 1;
    transition: all 0.3s ease;
    color: white;
}

.notification-status {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

@keyframes glow {
    0% { box-shadow: 0 0 4px #10b981; }
    100% { box-shadow: 0 0 8px #10b981; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);} 
    40% {transform: translateY(-10px);} 
    60% {transform: translateY(-5px);} 
}

/* Animation for notification icon when clicked - simplified */
.notification-icon.bounce {
    animation: none;
}

.notification-status {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

@keyframes glow {
    from {box-shadow: 0 0 5px #10b981;}
    to {box-shadow: 0 0 15px #10b981;}
}

.hero-section {
    text-align: center;
    margin-bottom: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.main-title {
    font-size: 50px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
    color: #4a90e2;
    text-align: center;
}

.subtitle {
    font-size: 26px;
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 30px;
    letter-spacing: -0.5px;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
}

.hero-description {
    font-size: 20px;
    font-weight: 400;
    color: #9ca3af;
    margin-bottom: 40px;
    max-width: 600px;
}

.section-title {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 30px;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.action-buttons {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 40px;
}

.action-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.primary-btn {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.4);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.primary-btn:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transition: width 0.3s ease;
    z-index: -1;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(74, 144, 226, 0.5);
}

.primary-btn:hover:before {
    width: 100%;
}

.secondary-btn {
    background: transparent;
    color: #4a90e2;
    border: 2px solid #4a90e2;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.15);
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
}

.secondary-btn:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: rgba(74, 144, 226, 0.3);
    transition: width 0.3s ease;
    z-index: -1;
}

.secondary-btn:hover {
    transform: translateY(-3px);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.4);
}

.secondary-btn:hover:before {
    width: 100%;
}

h1 {
    font-size: 48px;
    font-weight: 450;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
    color: #ffffff;
}

main p {
    font-size: 18px;
    margin-bottom: 15px;
    margin-top: 30px;
    color: #ffffff;
    font-weight: 500;
}

/* Filter buttons */
main button {
    background-color: #2d3748;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    margin-right: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

main button:hover {
    background-color: #4a5568;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

main button.active {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

/* See More Button */
.see-more-container {
    text-align: center;
    margin-top: 20px;
    padding: 20px 0;
    grid-column: 1 / -1; /* Span all columns in grid */
}

.see-more-btn {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.2);
}

.see-more-btn:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 114, 128, 0.3);
}

/* Contest list container */
.contest-list {
    margin-top: 30px;
    max-height: 600px; /* Increased height for better scrolling */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 10px 0 0; /* Right padding for scrollbar space */
    border-radius: 12px;
}

/* Custom scrollbar */
.contest-list::-webkit-scrollbar {
    width: 8px;
}

.contest-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.contest-list::-webkit-scrollbar-thumb {
    background: rgba(74, 144, 226, 0.3);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.contest-list::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 144, 226, 0.5);
}

/* Firefox scrollbar */
.contest-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(74, 144, 226, 0.3) rgba(255, 255, 255, 0.05);
}

#contestList {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* Individual contest cards */
.contest-card {
    background: linear-gradient(135deg, #2a2d3a 0%, #1e2028 100%);
    border: 1px solid #3a3d4a;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-height: 120px; /* Fixed minimum height */
    max-height: 140px; /* Fixed maximum height */
}

.contest-card:hover {
    background: linear-gradient(135deg, #32353f 0%, #24262e 100%);
    border-color: #4a5568;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.contest-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0; /* Allow shrinking */
    margin-right: 15px; /* Space between info and button */
}

.contest-platform {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 2px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contest-name {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
    hyphens: auto;
}

.contest-time {
    font-size: 13px;
    color: #d1d5db;
    font-weight: 500;
    background: rgba(74, 144, 226, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    width: fit-content;
    white-space: nowrap;
}

.participate-btn {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 100px;
}

.participate-btn:hover {
    background: linear-gradient(135deg, #357abd 0%, #2563eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        margin: 20px 15px;
        padding: 20px;
    }
    
    header {
        padding: 0;
    }
    
    main {
        padding: 0;
    }
    
    #contestList {
        grid-template-columns: 1fr;
        gap: 15px; /* Smaller gap on mobile */
    }
    
    h1 {
        font-size: 30px;
    }
    
    .contest-list {
        max-height: 500px; /* Smaller height on mobile */
        padding: 0 5px 0 0; /* Less padding on mobile */
    }
    
    .contest-card {
        min-height: 110px; /* Slightly smaller on mobile */
        max-height: 130px;
        padding: 15px; /* Less padding on mobile */
    }
    
    .contest-name {
        font-size: 14px; /* Smaller font on mobile */
    }
    
    .participate-btn {
        padding: 8px 15px; /* Smaller button on mobile */
        font-size: 12px;
        min-width: 80px;
    }
    
    .contest-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    /* Improve mobile touch targets */
    .notification-button, .install-btn {
        min-width: 40px;
        min-height: 40px;
        width: 40px !important;
        height: 40px !important;
    }
    
    .problems-btn {
        padding: 8px 18px !important;
        font-size: 14px !important;
    }
    
    .notification-icon {
        font-size: 20px !important;
    }
    
    /* Better mobile button layout */
    main p {
        font-size: 16px !important;
        margin: 20px 0 10px 0 !important;
    }
    
    main button {
        font-size: 14px !important;
        padding: 12px 20px !important;
        margin: 8px 8px !important;
        min-height: 44px !important;
    }
    
    .main-title {
        font-size: 38px !important;
        margin-bottom: 5px !important;
    }
    
    .subtitle {
        font-size: 22px !important;
        margin-bottom: 25px !important;
    }
    
    .section-title {
        font-size: 24px !important;
        margin-bottom: 20px !important;
    }
    
    .hero-section {
        margin-bottom: 40px !important;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }
    
    .action-btn {
        padding: 10px 20px !important;
        font-size: 13px !important;
        width: 100%;
    }
    
    .header-right {
        gap: 8px !important;
    }
    
    .contest-timing {
        text-align: center;
    }
}