/* Reset default styles for consistency */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body styling with a modern dark gradient background */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Container for content */
.max-w-7xl {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
}

/* Header styling with a glowing effect */
header h1 {
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(45deg, #00ddeb, #ff4081);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(0, 221, 235, 0.5);
}

header p {
    color: #b0b0b0;
    font-style: italic;
}

/* Table of Contents styling */
.toc {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 8px;
    position: sticky;
    top: 20px;
}

.toc h2 {
    color: #00ddeb;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.toc ul li a {
    color: #b0b0b0;
    transition: color 0.3s ease, transform 0.3s ease;
}

.toc ul li a:hover {
    color: #00ddeb;
    transform: translateX(5px);
}

/* Section headers with animated underline */
.section-header {
    position: relative;
    padding-bottom: 0.5rem;
    color: #00ddeb;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #00ddeb, #ff4081);
    transition: width 0.3s ease;
}

.section-header:hover::after {
    width: 100px;
}

/* Definition blocks with subtle glow */
.definition {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 0 15px rgba(0, 221, 235, 0.2);
}

/* Code blocks with modern styling */
.code-block {
    position: relative;
    background: #2d2d44;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.code-block pre {
    color: #e0e0e0;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4081;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.copy-btn:hover {
    background: #e91e63;
}

/* Tables with clean design */
table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

table td {
    padding: 0.75rem;
    color: #b0b0b0;
}

/* Floating mail button with animation */
.floating-mail-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(45deg, #00ddeb, #ff4081);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 221, 235, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    z-index: 2000; /* Ensure button stays above all content */
    opacity: 1; /* Always fully visible */
}

/* Ensure button remains visible on hover and active states */
.floating-mail-btn:hover,
.floating-mail-btn:active {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 221, 235, 0.7);
    opacity: 1; /* Maintain visibility */
}

/* Popup styling with fade-in animation */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.popup-content {
    background: #1a1a2e;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    margin: 15% auto;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 221, 235, 0.3);
}

.popup-content .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ff4081;
}

.popup-content .email-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: #00ddeb;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s ease;
}

.popup-content .email-link:hover {
    background: #00bcd4;
}

/* Support section styling */
.support-section {
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.support-section img {
    margin: 0 0.5rem;
    transition: transform 0.3s ease;
}

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

/* Footer styling */
.footer {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    color: #b0b0b0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .grid-cols-1 {
        grid-template-columns: 1fr;
    }

    .toc {
        position: static;
    }

    .floating-mail-btn {
        bottom: 10px;
        right: 10px;
        padding: 0.5rem 1rem;
        z-index: 2000; /* Maintain high z-index */
        opacity: 1; /* Ensure visibility */
    }

    .popup-content {
        margin: 30% auto;
    }
}

@media (max-width: 422px) {
    .grid-cols-1 {
        grid-template-columns: 1fr;
    }

    .toc {
        position: static;
    }

    .floating-mail-btn {
        bottom: 5px;
        right: 5px;
        padding: 0rem 0.5rem;
        z-index: 2000; /* Maintain high z-index */
        opacity: 1; /* Ensure visibility */
    }

    .popup-content {
        margin: 30% auto;
    }
}

/* Keyframes for animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}