/* CSS Variables */
:root {
    --primary-color: #007bff;
    --primary-hover-color: #0056b3;
    --danger-color: #dc3545;
    --danger-hover-color: #c82333;
    --text-color: #fff;
    --font-family: Arial, sans-serif;
    --border-radius: 5px;
    --container-width: 60%;
    --max-width: 500px;
    --small-max-width: 250px;
    --button-padding: 10px;
    --button-margin: 10px;
    --table-border: 1px solid #ddd;
    --table-padding: 8px;
    --table-header-bg: #f2f2f2;
    --popup-max-width: 400px;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    text-align: center;
    font-family: var(--font-family);
}

/* Logo style */
.logo {
    width: 100%;
    max-width: var(--max-width);
    display: block;
   margin: 5px auto;
}

/* Form container style */
.form-container {
    width: var(--container-width);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
}

.form-container h2 {
    text-align: center;
    margin: 0; /* Removes any margin around the header */
}


/* Form input style */
.form-input {
    width: calc(100% - 20px);
    padding: 10px;
    margin: 5px auto;
    box-sizing: border-box;
    font-size: 16px;
    display: block;
}

/* Button styles */
.password-toggle-button,
.form-submit,
.back-button,
.logout-button,
.add-date-button,
.choose-file-button {
    width: calc(100% - 20px);
    padding: var(--button-padding);
    margin: var(--button-margin) auto;
    box-sizing: border-box;
    font-size: 16px;
    display: block;
    cursor: pointer;
    color: var(--text-color);
    border: none;
    border-radius: var(--border-radius);
    text-align: center;
	text-decoration: none;
}

.password-toggle-button:hover,
.form-submit:hover,
.back-button:hover,
.add-date-button,
.choose-file-button:hover {
    background-color: var(--primary-hover-color);
}

.password-toggle-button,
.form-submit {
    background-color: var(--primary-color);
}

.logout-button,
.back-button {
    background-color: var(--danger-color);
    text-decoration: none;
}

.logout-button:hover,
.back-button:hover {
    background-color: var(--danger-hover-color);
}

/* Error message style */
.error-message {
    color: red;
    margin-bottom: 10px;
}

/* Checkbox style */
.form-checkbox {
    margin: 0 5px;
}

/* Additional button style */
.choose-file-button {
    display: inline-block;
}

.choose-file-button:hover {
    background-color: var(--primary-hover-color);
}

/* Hide the default file input */
.choose-file-button input[type="file"] {
    display: none;
}

/* Focus styles for accessibility */
.form-input:focus,
.password-toggle-button:focus,
.form-submit:focus,
.back-button:focus,
.form-button:focus {
    outline: 2px solid var(--primary-hover-color);
}

/* Image preview styling */
.image-preview {
    margin-top: 10px;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

.date-input {
    width: auto;
    margin-right: 10px;
}

.filter-button {
    margin-top: 10px;
}

/* Table styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border: var(--table-border);
    padding: var(--table-padding);
    text-align: left;
}

th {
    background-color: var(--table-header-bg);
}

/* Popup card style */
.popup-card {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: var(--popup-max-width);
    z-index: 9999;
}

.popup-card h2 {
    margin-bottom: 10px;
}

.popup-card p {
    margin-top: 10px;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Overlay style */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Show class for displaying elements */
.show {
    display: block;
}

/* Styles specific to grid buttons */
.grid-container {
    max-width: 600px;
    margin: 0 auto;
    margin-top: 10px;
}

.grid-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
}

.grid-buttons button {
    width: calc(50% - 10px);
    margin: 2px;
    padding: 8.5px;
    font-size: 18px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    background-color: var(--primary-color);
    color: var(--text-color);
}

.grid-buttons button:hover {
    background-color: var(--primary-hover-color);
}

.logout-button-container {
    margin-top: 10px;
}

@media only screen and (max-width: 600px) {
    .form-container {
        width: 100%;
        margin: 5 auto;
    }
    .form-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px; /* Adjust gap explicitly */
    }
    .logo {
        max-width: var(--small-max-width);
		
    }
    h1 {
        margin: 0; /* Reset any extra margins */
    }
}



/* PC styles */
@media only screen and (min-width: 601px) {
    .logo {
        max-width: var(--max-width);
	 
    }
    .form-container {
        width: 80%;
        max-width: var(--max-width);
		margin-top: 30px;
    }
    .form-input, 
    .password-toggle-button, 
    .form-submit, 
    .back-button, 
    .logout-button, 
    .choose-file-button {
        width: calc(100% - 40px);
    }
}

/* Image preview container styles */
.image-preview-container, .logo-preview-container {
    width: 150px; /* Adjust this width as needed */
    height: 150px; /* Keeps them uniform */
    border: 1px solid #ccc;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #f9f9f9;
    text-align: center;
}

.image-preview-container img, .logo-preview-container img {
    max-width: 100%;
    max-height: 100%;
}

/* New container for both images side by side */
.image-logo-container {
    display: flex;
    justify-content: space-between; /* Adds space between the images */
    gap: 10px; /* Adds space between the images */
    flex-wrap: wrap; /* Allows wrapping if the container is too narrow */
    margin-bottom: 10px;
}

/* Highlight required fields */
.required-field {
    background-color: #f0f0f0; /* Light grey color */
}

.required-field::after {
    content: " *"; /* Adding an asterisk to indicate it's required */
    color: red;
    font-weight: bold;
}

* Responsive styles */
.image-container {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.upload-field {
    flex: 1 1 200px;
    max-width: 300px;
}

.uploaded-image {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .image-container {
        flex-direction: column;
        align-items: center;
    }

    .uploaded-image {
        max-width: 150px;
        max-height: 150px;
    }
}

@media (max-width: 480px) {
    .form-container {
        padding: 10px;
    }

    .form-input,
    .form-submit {
        font-size: 14px;
    }
}

/* Highlight required fields */
.required-field {
    background-color: #f0f0f0;
}

.required-field::after {
    content: " *";
    color: red;
    font-weight: bold;
}