body {
    font-family: 'Roboto Mono', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    min-height: 100vh;
}

/* Navigation Bar Styling */
.nav-links {
    position: sticky;
    top: 0;
    background: linear-gradient(90deg, #2c3e50, #3498db);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    gap: 5px;
    z-index: 1000;
    margin-bottom: 20px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav-links.sticky {
    background: linear-gradient(90deg, #1a2634, #2980b9);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.nav-item {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 1em;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 44px; /* Ensure touch target size */
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item:hover {
    background-color: #e74c3c;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.nav-item:focus {
    outline: 2px solid #ff8e53;
    outline-offset: 2px;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.nav-item:hover::before {
    left: 100%;
}

.nav-item.active {
    background-color: #f1c40f;
    color: #2c3e50;
    font-weight: bold;
}

/* Cheatsheet Container */
.cheatsheet {
    max-width: 1100px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

header {
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(45deg, #2a2a4e, #3e3e6b);
    padding: 20px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0.3;
}

header h1 {
    color: #ff6b6b;
    font-size: 2.4em;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.header-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.profile-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    border: 2px solid #e0e0e0;
    transition: transform 0.3s ease;
}

.profile-img:hover {
    transform: scale(1.1);
}

.profile-text .program {
    color: #ff8e53;
    font-weight: bold;
    font-size: 1em;
}

.profile-text .name {
    color: #e0e0e0;
    font-size: 1.1em;
}

.profile-text .handle {
    color: #a0a0cc;
    font-style: italic;
}

.section {
    background-color: #0f1322;
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #2a2a4e;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.section:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.2);
}

.section h2 {
    color: #ff6b6b;
    font-size: 1.8em;
    margin-bottom: 12px;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: #ff8e53;
}

.subsection {
    margin-bottom: 20px;
}

.subsection h3 {
    color: #e0e0e0;
    font-size: 1.4em;
    margin-bottom: 10px;
    border-bottom: 2px solid #2a2a4e;
    padding-bottom: 6px;
}

.command {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    background-color: #1a1a2e;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #ff8e53;
    transition: background-color 0.3s ease;
}

.command:hover {
    background-color: #2a2a4e;
}

.command code {
    flex: 1;
    color: #4ecdc4;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.95em;
}

.comment {
    color: #a0a0cc;
    font-style: italic;
    font-size: 0.9em;
    margin-top: 6px;
    flex: 1;
}

.content {
    display: grid;
}

/* Floating mail button styles */
.floating-mail-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(to right, #25d366, #2fd673);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 40px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4);
    font-weight: 600;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px; /* Ensure touch target size */
}

.floating-mail-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.6);
}

.floating-mail-btn:focus {
    outline: 2px solid #25d366;
    outline-offset: 2px;
}

.floating-mail-btn:active {
    transform: translateY(1px);
}

/* Popup styles */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    max-width: 350px;
    width: 90%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    animation: popupAnimate 0.3s ease;
}

@keyframes popupAnimate {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s ease;
    min-height: 44px; /* Ensure touch target size */
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #e74c3c;
}

.popup-content h2 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 20px;
}

.popup-content p {
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 15px;
}

.email-link {
    display: inline-block;
    background: linear-gradient(to right, #6a11cb, #2575fc);
    color: white;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.4);
    min-height: 44px; /* Ensure touch target size */
    display: flex;
    align-items: center;
    justify-content: center;
}

.email-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(106, 17, 203, 0.6);
}

.email-link:focus {
    outline: 2px solid #6a11cb;
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
        padding: 8px;
    }

    .nav-item {
        width: 100%;
        text-align: center;
        padding: 10px;
        font-size: 0.9em;
    }

    .command {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
    }

    header h1 {
        font-size: 2em;
    }

    .profile-img {
        width: 45px;
        height: 45px;
    }

    .section {
        padding: 15px;
    }

    .section h2 {
        font-size: 1.6em;
    }

    .subsection h3 {
        font-size: 1.3em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .nav-links {
        flex-direction: row;
        align-items: center;
        padding: 5px;
        gap: 8px;
    }

    .nav-item {
        width: auto;
        padding: 8px 12px;
        font-size: 0.85em;
    }

    .cheatsheet {
        padding: 10px;
    }

    header {
        margin-bottom: 30px;
        padding: 15px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .profile-img {
        width: 40px;
        height: 40px;
    }

    .floating-mail-btn {
        bottom: 15px;
        right: 15px;
        padding: 10px 18px;
        font-size: 13px;
    }

    .popup-content {
        max-width: 300px;
        padding: 15px;
    }

    .popup-content h2 {
        font-size: 18px;
    }

    .popup-content p {
        font-size: 13px;
    }

    .email-link {
        padding: 8px 18px;
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    body {
        padding: 8px;
    }

    .nav-links {
        gap: 6px;
    }

    .nav-item {
        padding: 6px 10px;
        font-size: 0.8em;
    }

    header h1 {
        font-size: 1.6em;
    }

    .profile-img {
        width: 35px;
        height: 35px;
    }

    .profile-text .program,
    .profile-text .name {
        font-size: 0.9em;
    }

    .profile-text .handle {
        font-size: 0.85em;
    }

    .section {
        padding: 12px;
    }

    .section h2 {
        font-size: 1.4em;
    }

    .subsection h3 {
        font-size: 1.2em;
    }

    .command {
        padding: 8px;
    }

    .command code,
    .comment {
        font-size: 0.85em;
    }

    .floating-mail-btn {
        bottom: 10px;
        right: 10px;
        padding: 8px 15px;
        font-size: 12px;
    }

    .popup-content {
        max-width: 280px;
        padding: 12px;
    }

    .popup-content h2 {
        font-size: 16px;
    }

    .popup-content p {
        font-size: 12px;
    }

    .email-link {
        padding: 6px 15px;
        font-size: 12px;
    }

    .close {
        font-size: 18px;
    }
}