@font-face {
    font-family: gtAmerica;
    src: url('font/GT-America-Standard-Regular.otf') format('truetype');
}

* {
    box-sizing: border-box;
}

body {
    font-family: gtAmerica;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 20px;
    font-size: 0.8em;
    color: darkblue;
    min-height: 100vh;
}

#main-container {
    position: relative;
    top: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    width: 100%;
    max-width: 2400px;
}

/* HEADER */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    background-color: white;
    height: 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
}

#page-logo, #page-title, #selected-count, .file-titles {
    font-size: 1.5em;
    flex: 1;
    margin: 0 30px;
}

#page-logo { text-align: left; }
#page-title { text-align: center; }
#selected-count { text-align: right; }

/* LOGIN */
#login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

#login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#login-form input, #login-form button {
    padding: 10px;
    margin-bottom: 10px;
}

/* GRID */
.grid-container {
    margin-top: 100px;
    width: 100%;
    max-width: 1500px;
    padding: 0 20px;
    flex-grow: 1;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 4vh;
    width: 100%;
    max-width: 1500px;
}

/* INTRANET FILE CONTAINERS */
.file-container {
    position: relative;
    padding: 20px;
    height: 180px;
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
}

.file-header {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.file-name {
    font-size: 1em;
    font-family: gtAmerica;
    color: #333;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
    max-width: 60%;
}

.file-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.copy-link, .visit-project {
    font-size: 0.9em !important;
    font-family: gtAmerica !important;
    color: #555 !important;
    background: none !important;
    border: none !important;
    padding: 4px 8px !important;
    cursor: pointer;
    text-decoration: underline;
}

.file-info {
    position: absolute;
    bottom: 15px;
    left: 15px;
    font-size: 0.9em;
    font-family: gtAmerica;
    color: #666;
    line-height: 1.3;
}

/* CONTENT.PHP GRID */
.image-container {
    position: relative;
    width: 100%;
    padding: 4% 4% 22% 4%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    aspect-ratio: 1 / 1.3;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border: solid 25px white;
}

.image-container.selected img {
    border-color: rgb(213, 233, 255);
}

/* FORM ELEMENTS */
.select-all-container {
    display: flex;
    align-items: center;
    margin-left: 1%;
    margin-bottom: 15px;
    width: 100%;
}

.footer {
    font-family: gtAmerica;
    font-size: 1em;
    margin: 40px 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.footer input, .footer button {
    height: 50px;
    padding: 0 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

#name-field { flex: 0.3; width: 300px; }
#notes-field { flex: 1; }

.footer button {
    background-color: rgb(213 233 255);
    color: darkblue;
    cursor: pointer;
}

/* FULLSCREEN */
.fullscreen {
    display: none;
    position: fixed;
    top: 100px;
    left: 0;
    width: 100%;
    height: calc(100% - 100px);
    background: white;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

.fullscreen-container {
    position: relative;
    padding: 2% 0 10% 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.fullscreen img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.fullscreen-container.selected img {
    border: solid 25px rgb(213, 233, 255);
}

.fullscreen-controls {
    position: fixed;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px;
}

.fullscreen-controls button, .fullscreen-controls input[type="checkbox"] {
    margin: 10px;
    padding: 10px 20px;
    cursor: pointer;
    background-color: #fff;
    border: none;
    border-radius: 4px;
    flex: 1;
}

/* MESSAGES */
.error, .error-message, .downloaded-message { color: red; }
.message { color: blue; }
.success-message { color: green; }

#form-message {
    margin: 43px 10px 14px 10px;
    text-align: center;
}

/* IMAGE OVERLAYS */
.image-container .image-name {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 5px;
    border-radius: 5px;
    text-align: center;
    max-width: 90%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    z-index: 1;
}

.image-container .magnifier {
    position: absolute;
    bottom: 3px;
    right: 15px;
    font-size: 2em;
    cursor: pointer;
    z-index: 1;
}

.image-container input[type="checkbox"] {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: white;
    border: 1px solid #ccc;
    padding: 5px;
    border-radius: 5px;
    z-index: 1;
}

.image-container .info-container {
    position: absolute;
    bottom: 35px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    z-index: 2;
}

.image-container .info-container .image-date,
.image-container .info-container .image-description {
    font-size: 0.8em;
    background: rgba(255, 255, 255, 0.7);
    padding: 2px 5px;
    border-radius: 3px;
    max-width: 45%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* DOWNLOAD */
.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.content .button {
    display: inline-block;
    padding: 10px 20px;
    margin: 10px;
    font-size: 1em;
    color: darkblue;
    background-color: rgb(213, 233, 255);
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    body {
        font-size: 0.5em;
        width: 100%;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
    }
    
    .header { height: 80px; }
    #main-container { top: 80px; }
    
    .grid {
        grid-template-columns: 1fr 1fr;
        width: 100vw;
        padding: 10px;
    }
    
    .footer {
        flex-direction: column;
        gap: 10px;
    }
    
    #name-field, #notes-field { width: 100%; flex: none; }
    
    .magnifier, .select-all-container { display: none; }
    .image-container input { display: none; }
}

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

@media (min-width: 2800px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
        max-width: 2600px;
    }
    .grid-container { max-width: 2400px; margin-top: 120px; }
}

#page-title,
#page-logo,
.file-titles,
#selected-count {
    font-size: 1.5em;
    flex: 1;
    margin: 0 30px;
}

#submit-button {
    flex: 0;
    align-items: right;
}

#page-logo {
    text-align: left;
}

#selected-count {
    text-align: right;
}

#page-title {
    text-align: center;
}

/* Styles for the download page */
.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.content .button {
    display: inline-block;
    padding: 10px 20px;
    margin: 10px;
    font-size: 1em;
    color: darkblue;
    background-color: rgb(213, 233, 255);
    border: none;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.footer {
    font-family: gtAmerica;
    font-size: 1em;
    margin: 40px 0px 40px 0;
    width: 100%;
    display: flex;
    justify-content: space-around; /* Space items evenly */
    align-items: center; /* Center the items vertically */
    font-size: 1em;
    position: relative; /* Normal flow positioning */
    text-align: center;
    /* Ensure the footer stays at the bottom */
    flex-shrink: 0;
    gap: 20px; /* Space between input fields and button */
}

.footer form {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
}

.footer input,
.footer button {
    height: 50px; /* Consistent height for inputs and button */
    padding: 0 10px; /* Adjust padding as needed */
    border-radius: 5px; /* Rounded corners for inputs and button */
    border: 1px solid #ccc;
}

#name-field {
    flex:0.3;
    width:300px;
}

#notes-field {
    flex:1;
}
.footer button {
    background-color: rgb(213 233 255);
    color: darkblue;
    cursor: pointer;
}

.footer .message {
    color: red;
    text-align: center;
    flex: 1;
}

.grid-container {
    margin-top: 100px; /* Adjust based on header height */
    width: 100%;
    max-width: 1500px;
    padding: 0 20px;
    flex-grow: 1; /* Allow the grid to grow and push the footer to the bottom */
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 4vh;
    width: 100%;
    max-width: 1500px;
}

.image-container {
    position: relative;
    width: 100%;
    padding: 4% 4% 22% 4%;
    /* background-color: #f0f0f0; */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    flex-direction: column;
    aspect-ratio: 1 / 1.3;
    /* Add this line */
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}



.file-container {
    position: relative;
    width: 100%;
    padding: 4% 4% 14% 4%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    cursor: pointer;
    background-color: #f0f0f0; /* Grey background for file items */
    transition: background-color 0.3s ease;
    margin-bottom: 10px;
    max-width: 37vw;
}


.error-message {
    color: red;
}

/* Always have a 25px border, default as transparent */
.image-container img, .fullscreen-container img {
    border: solid 25px white;
}

/* Change the border color for selected images */
.image-container.selected img, .fullscreen-container.selected img {
    border-color: rgb(213, 233, 255); /* Blue border for selected images */
}

.file-container:hover {
    background-color: #e0e0e0; /* Slightly darker grey on hover */
}

.file-item {
    text-align: center;
}

.additional-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px; /* Adjust as needed */
    padding: 5px 0px 5px 0px;
    width: 100%;
}

.info-date {
    flex: 1; /* Ensures the date takes up available space on the left */
    text-align: left;
}

.info-description {
    flex: 1; /* Ensures the description takes up space on the right */
    text-align: right;
}

.copy-link, .delete-item, .visit-project {
    margin-top: 5px;
    padding: 5px 10px;
    font-size: 0.9em;
    cursor: pointer;
}

.copy-link {
    background-color: #4CAF50; /* Green */
    color: white;
    border: none;
    border-radius: 3px;
}

.delete-item {
    background-color: #f44336; /* Red */
    color: white;
    border: none;
    border-radius: 3px;
    margin-top: 5px;
}

.visit-project {
    background-color: #2196F3; /* Blue */
    color: white;
    border: none;
    border-radius: 3px;
    margin-top: 5px;
}


.file-titles {
    flex: 1;
    margin: 40px 0 40px 10px;
}

.copy-link:hover, .delete-item:hover, .visit-project:hover {
    opacity: 0.8;
}





.image-container .image-name {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 5px;
    border-radius: 5px;
    text-align: center;
    max-width: 90%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    z-index: 1;
    /* Add this line to ensure it appears above the checkbox */
}

.image-container .magnifier {
    position: absolute;
    bottom: 3px;
    right: 15px;
    /* color: #007bff; */
    font-size: 2em;
    cursor: pointer;
    z-index: 1;
}

.image-container input[type="checkbox"] {
    position: absolute;
    bottom: 10px;
    left: 10px;
    /* Adjust this value as needed */
    background: white;
    border: 1px solid #ccc;
    padding: 5px;
    border-radius: 5px;
    z-index: 1;
}


.fullscreen {
    display: none;
    position: fixed;
    top: 100px;
    /* Adjust this to match the height of your header */
    left: 0;
    width: 100%;
    height: calc(100% - 100px);
    /* Adjust this to match the height of your header */
    background: white;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    /* Prevent scrolling */
}

.fullscreen-container {

    position: relative;
    padding: 2% 0% 10% 0%;
    /* background-color: #f0f0f0; */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    flex-direction: column;
}

.fullscreen img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
    max-width: 100%;
    height: auto;
    visibility: visible; /* Ensure visibility is not set to hidden */
}

img {
    display: block;
    max-width: 100%;
    height: auto;
    visibility: visible; /* Ensure visibility is not set to hidden */
}


.fullscreen-container.selected img {
    border: solid 25px rgb(213, 233, 255);
}


.fullscreen-controls {
    position: fixed;
    bottom: 0px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px;
}

.fullscreen-controls button,
.fullscreen-controls input[type="checkbox"] {
    margin: 10px;
    padding: 10px 20px;
    cursor: pointer;
    background-color: #fff;
    border: none;
    border-radius: 4px;
    flex: 1;
}

.fullscreen-controls button {
    flex: 1;
}

.fullscreen-controls .middle-button {
    flex: 1;
}

.message {
    color: blue;
}

.downloaded-message {
    color: red;
}


/* Style for the info container */
.image-container .info-container {
    position: absolute;
    bottom: 35px; /* Adjust this value to position above the image name and controls */
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center; /* Vertically center the text */
    padding: 0 10px; /* Horizontal padding */
    box-sizing: border-box;
    z-index: 2;
}

/* Style for the date and description */
.image-container .info-container .image-date,
.image-container .info-container .image-description {
    font-size: 0.8em; /* Adjust font size as needed */
    background: rgba(255, 255, 255, 0.7); /* Semi-transparent background */
    padding: 2px 5px;
    border-radius: 3px;
    max-width: 45%; /* Prevent overlap */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Align date to the left */
.image-container .info-container .image-date {
    text-align: left;
}

/* Align description to the right */
.image-container .info-container .image-description {
    text-align: right;
}

.success-message {
    color: green;
}

#form-message {
    margin: 43px 10px 14px 10px;
    text-align: center;

}

.file-container {
    position: relative;
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    background: linear-gradient(145deg, #f0f0f0, #e8e8e8);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.file-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.file-name {
    font-size: 1.2em;
    margin: 0;
    flex-grow: 1;
    display: flex;
    align-items: center;
    min-height: 60px;
}

.file-buttons {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.copy-link, .visit-project {
    padding: 8px 16px;
    font-size: 0.85em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    flex: 1;
    text-align: right;
}

.copy-link {
    background: #4CAF50;
    color: white;
}

.copy-link:hover { background: #45a049; }

.visit-project {
    background: #2196F3;
    color: white;
}

.visit-project:hover { background: #1976D2; }

.file-count {
    background: rgba(255,255,255,0.9);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    color: #666;
    font-weight: 500;
    border: 1px solid #ddd;
}

.file-info-bar {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.95);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75em;
    color: #555;
    font-family: gtAmerica;
    border: 1px solid #e0e0e0;
    white-space: nowrap;
}

.file-container {
    position: relative;
    padding: 20px;
    height: 180px;
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
}

.file-header {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.file-name {
    font-size: 1em;
    font-family: gtAmerica;
    color: #333;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
}

.file-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.copy-link, .visit-project {
    font-size: 0.9em !important;
    font-family: gtAmerica !important;
    color: #555 !important;
    background: none !important;
    border: none !important;
    padding: 4px 8px !important;
    cursor: pointer;
    text-decoration: underline;
}

.file-info {
    position: absolute;
    bottom: 15px;
    left: 15px;
    font-size: 0.9em;
    font-family: gtAmerica;
    color: #666;
    line-height: 1.3;
}

.fullscreen-container img {
    border: solid 25px white;
    transition: border-color 0.2s ease;
}

.fullscreen-container.selected img {
    border: solid 25px rgb(213, 233, 255) !important;
}

.grid h3 {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px 10px 10px;
    margin: 0;
    font-size: 1.2em;
    color: #666;
    border-bottom: 2px solid #ddd;
}

.grid:first-of-type h3 {
    color: #28a745;
    font-weight: bold;
}

/* Mobile Styles */
/* Mobile Styles */
@media (max-width: 768px) {
    body {
        font-size: 0.5em;
        width: 100%;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
    }

    .image-container {
        aspect-ratio: auto; /* Reset aspect ratio */
    }

    .image-date, .image-description {
        position: absolute;
        bottom: 35px; /* Adjust as needed to position above other elements */
        font-size: 0.8em;
        background: rgba(255, 255, 255, 0.7);
        padding: 2px 5px;
        border-radius: 3px;
        z-index: 2;
    }
    
    .image-date {
        left: 10px;
        text-align: left;
    }
    
    .image-description {
        right: 10px;
        text-align: right;
        max-width: 50%; /* Adjust as needed */
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    #main-container {
        width: 100%;
            /* margin-top: 200px; */
        margin: 0 auto !important;
    }

    .header {
        width: 100%;
        box-sizing: border-box;
    }

    #page-title,
    #page-logo,
    #selected-count {
        font-size: 1.4em;
    }

    .magnifier {
        display: none;
    }

    .select-all-container {
        display: none;
    }

    .image-container input {
        display: none !important;
    }

    .image-container .image-name { 
        font-size: 1.4em;
    }

    .grid {
        grid-template-columns: 1fr 1fr;
        width: 100vw;
        margin: 0 auto;
        padding: 10px;
    }

    .image-container {
        width: 100vw;
        padding: 0;
        margin: 0;
        aspect-ratio: auto;
        padding: 2% 2% 4% 2%;
    }

    .image-container img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        margin: 0 !important;
        padding: 0 !important;
    }


    .image-container .info-container {
        display: none;
    }

    .footer {
        padding: 15px 20px !important;
        gap: 10px !important;
        margin: 20px 0 !important;
    }
    
    .footer input, .footer button {
        height: 45px !important;
        font-size: 1em !important;
        padding: 10px !important;
    }

        #name-field {
        flex: 1 !important;
        min-width: 0;
    }
    
    #notes-field {
        flex: 1.5 !important;
    }

        body {
        touch-action: manipulation;
        overflow-x: hidden;
        max-width: 100%;
        -webkit-text-size-adjust: 100%;
        -webkit-user-scalable: no;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Prevent zoom on input focus */
    input, button {
        font-size: 16px !important; /* Prevents iOS zoom */
    }
    

}

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

/* Styles for larger screens */
@media (min-width: 2800px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
        max-width: 2600px;
        gap: 4vh;
    }

    .grid-container {
        max-width: 2400px;
        margin: 0 auto; /* Center the grid */
        margin-top: 120px; /* Adjust this value to match the height of your header */
        flex-grow: 1; /* Allow the grid to grow and push the footer to the bottom */
    }
}

@media (min-width: 769px) {
    .selected-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 20px !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }
}

/* iPad fix - smaller columns between 769px-1024px */
@media (max-width: 1024px) and (min-width: 769px) {
    .selected-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .grid {
        grid-template-columns: repeat(2, 1fr) !important;
        width: 100% !important;
        max-width: 100vw !important;
        padding: 0 15px !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }
}

@media (min-width: 1201px) {
    .selected-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}