/* ICONS FOR SITE ARE FROM https://www.svgrepo.com/collection/solar-broken-line-icons/4 */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body, html {
    font-family: "Nunito Sans", sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    background: #e8e8e8;
}

#stored-filename {
    font-family: "Arvo", serif;
	font-weight: bold;
}

h1, h2, h3, h4, h5  {
	display: flex;
	align-items: center;
	justify-content: flex-start;
    font-family: "Arvo", serif;
	font-weight: normal;
}

.header-img {
	width: 25px;
	height: 25px;
	margin-right: 10px;
}

.logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.head-logo {
  font-size: 1.3vw;
  display: flex;
  font-family: "Arvo", serif;
  font-weight: bold;
  letter-spacing: 0.5px;
  align-items: center;
  justify-content: center;
}

.icon-logo {
  width: 25px;
  height: 25px;
  margin-right: 10px;
}

.date-stamp {
	font-size: 0.75em;
	color: rgba(255,255,255,0.45);
}

a {
    text-decoration: none;
    color: inherit;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 220px;
    background: #151933;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    z-index: 10;
}

.side-name {
	color: rgba(255,255,255,0.5);
	margin-top: 5px;
	margin-bottom: 15px;
	font-size: 0.85rem;
	width: 100%;
	text-align: center;
}

.sidebar h1 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #ff6e6e;
}

.sidebar nav {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar nav a {
	display: flex;
	align-items: center;
	justify-content: flex-start;
    padding: 10px;
    border-radius: 4px;
    color: #fff;
    transition: background 0.5s ease;
}

.sidebar nav a:hover {
    background: #2c2c4a;
    transition: background 0.5s ease;
}

.nav-icon { 
	margin-right: 5px;
	width: 20px;
	height: 20px;
}


.copy-icon { 
	width: 25px !important;
	height: 25px !important;
}

.sidebar footer {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: auto;
}

/* Main Content */
.main-content {
    margin-left: 220px;
    flex-grow: 1;
    padding: 2rem;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Responsive: Collapse Sidebar */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 10px 15px;
    }

    .sidebar h1 {
        font-size: 1.2rem;
        margin: 0;
    }

    .sidebar nav {
        flex-direction: row;
        gap: 15px;
        flex-grow: unset;
    }

    .sidebar nav a {
        padding: 5px 10px;
    }

    .sidebar footer {
        display: none;
    }
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    padding: 10px 0;
}

.image-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 12px;
    width: 100%;
    height: 100%;
	border-radius: 4px;
}

.image-wrapper {
    flex-grow: 1;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
    background: #eee;
	border: 1px solid rgba(0,0,0,0.4);
	border-radius: 4px;
}

.image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.20), transparent);
    pointer-events: none;
    z-index: 2;
}

.image-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-copy {
    position: absolute;
    top: 2px;
    right: 2px;
    color: white;
    font-size: 1.85em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: background 0.2s ease;
}

.copied-popup {
    position: absolute;
    top: 0px;
    right: 0px;
	width: 100%;
    background: rgba(0,130,80,0.7);
    color: #fff;
    padding: 10px 8px;
    border-radius: 3px;
    font-size: 1em;
	font-weight: bold;
    white-space: nowrap;
    opacity: 0;
	text-transform: uppercase;
    transform: translateX(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 3;
}

.drop-image {
	max-width: 400px;
	min-width: 100px;
	width: 40%;
	opacity: 0.3;
}

.image-wrapper.show-popup .copied-popup {
    opacity: 1;
    transform: translateX(0);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.upload-btn {
    background: #0052cc;
    color: white;
    padding: 6px 10px;
    font-size: 14px;
    text-decoration: none;
    border-radius: 4px;
}

.select-album .album-select-wrapper {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
}

.select-album .album-select-wrapper img.header-img {
	width: 22px;
	height: 22px;
	object-fit: contain;
	flex-shrink: 0;
}

.select-album .album-select-wrapper select {
	flex: 1;
	width: 100%;
	padding: 6px 8px;
	font-size: 14px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background-color: #fff;
	box-sizing: border-box;
}

/* --- new album inline layout --- */
.select-new-album .new-album-wrapper {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 3px;
	width: 100%;
}

.select-new-album .new-album-wrapper img.header-img {
	width: 20px;
	height: 20px;
	object-fit: contain;
	flex-shrink: 0;
	display: block;
}

.select-new-album .new-album-wrapper label {
	font-size: 14px;
	color: #333;
	flex-shrink: 0;
	line-height: 1;
	margin-top: 10px;
}

.select-new-album .new-album-wrapper input[type="text"] {
	flex: 1;
	padding: 6px 8px;
	font-size: 14px;
	border: 1px solid #ccc;
	border-radius: 4px;
	box-sizing: border-box;
}


/* Album Grid (default view of all albums) */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    padding: 10px 0;
}

.album-card {
    display: flex;
    flex-direction: column;
	align-items: space-between;
    justify-content: flex-start;
    font-size: 12px;
    width: 100%;
    height: 100%;
    border-radius: 4px;
	background: rgba(0,0,0,0.3);
}

.album-card img,
.empty-thumb {
    flex-grow: 1;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: #eee;
    border: 1px solid rgba(0, 0, 0, 0.4);
    border-radius: 4px;
}

.album-title {
	font-weight: bold;
	margin: 5px;
	font-size: 14px;
	text-align: center;
	color: #333;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.empty-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
    font-style: italic;
    background: repeating-linear-gradient(
        45deg,
        #f5f5f5,
        #f5f5f5 10px,
        #e0e0e0 10px,
        #e0e0e0 20px
    );
}

/* Album view image grid */
.album-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    padding: 10px 0;
}

.album-image-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(0, 0, 0, 0.4);
    border-radius: 4px;
}

/* Form */


form input[type="text"],
form input[type="email"],
form input[type="password"] {
	background: #f9f9f9;
    width: 90%;
    max-width: 400px;
    padding: 8px;
    margin: 6px auto;
    display: block;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: "Nunito Sans", sans-serif;
}

form select {
  background: #f9f9f9;
  width: 90%;
  max-width: 400px;
  padding: 8px;
  margin: 6px auto;
  display: block;
  border: 1px solid #ccc;
  border-radius: 4px;
  -webkit-appearance: none; 
  -moz-appearance: none;
  appearance: none;
    font-family: "Nunito Sans", sans-serif;
}


form button {
    padding: 10px 20px;
    background-color: #293661;
    color: #fff;
    border: none;
    border-radius: 4px;
    margin-top: 10px;
    cursor: pointer;
	text-transform: uppercase;
	font-weight: bold;
    font-family: "Nunito Sans", sans-serif;
}

form button:hover {
    background-color: #394776;
}


/* Error message styling */
.message {
    background: #ffe0e0;
    color: #b00000;
    border: 1px solid #d99;
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.message.success {
    background: #e0ffe0;
    color: #006600;
    border: 1px solid #7fcb7f;
    padding: 8px;
    margin-top: 15px;
    border-radius: 4px;
    font-size: 14px;
}

.message.error {
    background: #ffe0e0;
    color: #b00000;
    border: 1px solid #d99;
    padding: 8px;
    margin-top: 15px;
    border-radius: 4px;
    font-size: 14px;
}

#uploadForm {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.form-section {
    margin-bottom: 20px;
}

#uploadForm label {
    font-weight: bold;
    display: block;
    margin-bottom: 6px;
}

#uploadForm input[type="text"],
#uploadForm select,
#uploadForm input[type="file"] {
    width: 100%;
    max-width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
