/* Global styling */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    scroll-behavior: smooth;
}

html {
    scroll-behavior: smooth;
}


body {
    background-color: #f5f5f7;
    color: #1d1d1f;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;
}

h1 {
    margin: 40px 0;
    text-align: center;
    font-size: 2.5rem;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.5px;
}

/* Category navigation menu */
.category-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 12px;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(22, 22, 23, 0.8);
    border-bottom: 1px solid #d2d2d7;
}

.category-nav a {
    color: #fafafa;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.category-nav a:hover {
    background-color: #f0f0f5;
    color: #1d1d1f;
}

/* Container for categories */
.category-container {
    width: 100%;
    padding: 0 20px;
    max-width: 1200px;
    margin: auto;
    flex: 1;
}

/* Styling each category section */
.category {
    background-color: #ffffff;
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 40px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.category h2 {
    font-size: 1.8rem;
    padding: 20px;
    text-align: center;
    color: #1d1d1f;
    background-color: #f5f5f7;
    border-bottom: 1px solid #d2d2d7;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Adjusts image sizes */
    gap: 12px;
    padding: 12px;
}


.image-grid img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-grid img:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}

/* Responsive Canvas Styling */
#imageCanvas {
    width: 100%; /* Canvas takes full width of its container */
    height: auto; /* Maintains aspect ratio */
    max-width: 500px; /* Limits maximum width for larger screens */
    border-radius: 10px;
    /*box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);*/
}

#downloadButton {
    width: 50%;
    max-width: 120px;
    padding: 10px 20px;
    font-size: 1rem;
    color: #ffffff;
    background: linear-gradient(135deg, #4CAF50, #008CBA); /* Original gradient color */
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

#downloadButton:hover {
    background: linear-gradient(135deg, #43A047, #007BB5); /* Hover color gradient */
    transform: translateY(-2px);
}

#downloadButton:active {
    transform: translateY(1px);
}


/* Footer styling */
footer {
    background-color: #fafafa;
    padding: 20px 0;
    border-top: 1px solid #d2d2d7;
    text-align: center;
    color: #6e6e73;
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #6e6e73;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #0071e3;
}

/* Popup Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}
.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 80%;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s;
}
.modal-content h2 {
    margin-top: 0;
}
.close-btn {
    cursor: pointer;
    font-size: 1.5em;
    position: absolute;
    top: 15px;
    right: 20px;
    color: #333;
}

.alphabet-nav {
    text-align: center;
    margin-bottom: 20px;
}

.alphabet-nav p {
    font-size: 1rem;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.alphabet-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.alphabet-links a {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 4px;
    background-color: #0071e3;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.alphabet-links a:hover {
    background-color: #005bb5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .alphabet-links a {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
}


@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
        margin: 20px 0;
    }    

    .category h2 {
        font-size: 1.5rem;
    }

    

    .category-nav a {
        padding: 8px 0px;
        font-size: 0.9rem;
    }

    .category-container {
        padding: 0 10px; /* Reduces padding on smaller screens */
    }

    #overlayText,
    #downloadButton {
        /*max-width: 50%;*/
        font-size: 0.9rem;
        padding: 8px;
        box-sizing: border-box;
    }

    #downloadButton {
        padding: 8px 16px;
    }
    
    footer {
        padding: 15px;
    }

    .footer-links {
        flex-direction: column;
    }
    
}

@media (max-width: 480px) {
    .modal-content {
        width: 90%; /* Adjust to fit smaller screens */
        padding: 15px; /* Reduce padding */
    }
    .close-btn {
        font-size: 1.2em; /* Adjust close button size */
    }
}

.name-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    padding: 20px;
}

.name-list a {
    text-decoration: none;
    color: #0071e3;
    font-weight: 500;
    transition: color 0.3s ease;
}

.name-list a:hover {
    color: #005bb5;
}

.alphabet-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #fff;
    padding: 10px 0;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1); /* Shadow for visibility */
}

.alphabet-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.alphabet-links a {
    padding: 8px 12px;
    background-color: #6a7075;
    color: #fff;
    font-weight: bold;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.alphabet-links a:hover {
    background-color: #005bb5;
}

#A {
    width: 100%;
    height: 0;
    padding: 0;
    margin: 0;
}
 /* Additional responsive styling */
 .controls-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.control-group {
    flex: 1 1 100%;
    /* Full width on small screens */
    max-width: 300px;
    /* Restrict maximum width */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 5px;
}

.control-group label {
    font-weight: bold;
    margin-bottom: 5px;
}

.control-group input,
.control-group select,
.controls-container button {
    width: 100%;
    
    
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .controls-container {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .control-group {
        flex: 1;
        max-width: none;
        text-align: left;
    }

    .control-group label {
        text-align: left;
        font-size: 0.9rem;
    }
}


