/* Reset and general styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

body {
    background-color: #0e1012;
    color: #f9f9f9;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

/* Desktop grid layout with sidebar */
.container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    width: 100%;
    height: 100%;
    padding-top: 50px;
    grid-template-areas:
        "sidebar main";
}

#photoContainer {
    overflow-y: scroll;
    overflow-x: hidden;
}

/* In-app login screen (replaces the browser's native auth dialog) */
#loginContainer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.login-box {
    background: #1e2124;
    border: 1px solid #00bcd4;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 188, 212, 0.25);
    padding: 32px 28px;
    width: 340px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-box h1 {
    font-size: 20px;
    color: #00bcd4;
    text-align: center;
}

.login-sub {
    font-size: 12px;
    color: #d7d7d7;
    text-align: center;
    margin-bottom: 8px;
}

.login-box input {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #00bcd4;
    background-color: #0e1012;
    color: #f9f9f9;
}

.login-box input:focus {
    outline: none;
    border-color: #00ffff;
}

.login-box #loginSubmit {
    padding: 10px;
    font-size: 14px;
    margin-top: 4px;
}

.login-box #loginSubmit:disabled {
    opacity: 0.6;
    cursor: wait;
}

.login-error {
    color: #ff34e1d8;
    font-size: 12px;
    min-height: 14px;
    text-align: center;
}

/* User selection (after login, first time only) */
#userSelectContainer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

#userSelectContainer h1 {
    margin-bottom: 20px;
    font-size: 24px;
    color: #00bcd4;
}

#userSelect {
    width: 300px;
    padding: 10px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #00bcd4;
    background-color: #1e2124;
    color: #f9f9f9;
    margin-bottom: 20px;
}

#userSelect:focus {
    outline: none;
    border-color: #008c9e;
}

/* Global button styling (smaller buttons) */
button {
    background-color: #00bcd4;
    border: none;
    padding: 6px 10px;
    font-size: 12px;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #008c9e;
}

button:active {
    transform: scale(0.95);
}

button.selected-vote {
    background-color: #ff34e1d8;
    color: #ffffff;
}

/* Button text */
button#Good:before {
    content: "Good";
}

button#Maybe:before {
    content: "Maybe";
}

button#ProbablyNot:before {
    content: "Probably Not";
}

button#Nope:before {
    content: "Nope";
}

button#NextButton:before {
    content: "Next ❯";
}

button#PreviousButton:before {
    content: "❮ Prev";
}


/* Album selection  */
#albumSelectContainer {
    padding: 20px;
    overflow-y: scroll;
    overflow-x: hidden;
}

.albumSelect {
    width: 100%;
}

.albumSelect h1 {
    text-align: center;
    color: #00bcd4;
    font-weight: 600;
}
.album-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  margin-top: 48px;
}

.album-card-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.1s;
  padding-bottom: 30px;
}

.album-card-wrapper:hover {
  transform: translateY(-4px) scale(1.04);
}

.album-card {
  background: #00bcd4;
  border: 15px solid #00bcd4;
  border-radius: 12px;
  box-shadow: 0 -6px 24px rgba(0,188,212,0);
  width: 400px;
  max-width: 80%;
  height: auto;  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.8s;
}

.album-card:hover {
  box-shadow: 0 -6px 24px rgba(0,188,212,.8);

}

.album-thumb {
  /* width: 400px;
  height: 300px; */
  object-fit: cover;
  border-radius: 8px;
  background: #222;
  display: block;
}

.album-label {
  font-size: 1.2em;
  font-weight: 600;
  color: #00bcd4;
  text-align: center;
  margin-top: 4px;
  word-break: break-all;
}

#scan-btn {
    position: absolute;
    z-index: 999;
    bottom: 20px;
    color: #000;
    font-size: 1.1em;
    font-weight: 600;
}

/* Checkbox for skipping voted photos */
.skip-voted-photos {
    text-align: center;
    color: #00e3ff;
    padding: 5px 0;
}

/* Filter modal window */
#filterForm {
	font-size: 1em;
}

#filterModal.modal {
	box-shadow: 0 0 100px 20px #000;
}

@media(max-width: 640px) {
	#filterModal.modal {
		width: 18em;
	}
}

.filterPhotosHeader {
	text-transform: uppercase;
	text-align: center;
	padding-bottom: 1em;
}

.filter-container {
    text-align: center;
}

.filterFormRow {
    margin-bottom: 1em;
	text-align: center;
}

.filterFormRow label {
	color: #d7d7d7;
	vertical-align: middle;
	display: inline-block;
	width: 2.2em;
}

.filterFormLabel {
    font-weight: 600;	
	text-align: center;
	color: #00e3ff;
	padding-bottom: .2em;
}


#filterForm input {
	font-size: inherit;
	vertical-align: middle;
	width: 3em;
	background: #000;
	color: #00e3ff;
	border: 2px solid #000;
	border-radius: .2em;
	margin-right: -.2em;;
}

#filterForm .clear-input {
	font-size: 1.2em;
	vertical-align: middle;
}

#filterForm .clear-input:nth-of-type(odd){
	padding-right: .5em;
}

.closeFilterWindowButton {
    float: right;
}

/* Clear filter input buttons */
.clear-input {
  cursor: pointer;
  margin-left: 4px;
  color: #d7d7d7;
  /* font-weight: bold; */
  user-select: none;
}

#filterForm .clear-input {
	font-size: 1.3em;
	vertical-align: middle;
}

#filterForm .clear-input:nth-of-type(odd){
	padding-right: .5em;
}
.clear-input:hover {
  color: #ff34e1d8;
}

.buttonRow {
    padding-top: 1.5em;
}

.filterFormLabel {
    font-weight: 600;
}

/* Sidebar on desktop */
.sidebar {
    grid-area: sidebar;
    background-color: #1e2124;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.sidebar h2 {
    font-size: 20px;
    color: #00bcd4;
    margin-bottom: 10px;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 10px;
}

/* Main content on desktop */
.main-content {
    grid-area: main;
    display: flex;
    width: 100%;
    flex-direction: column;
    justify-content: space-between;
}

/* Photo container */
.photo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1e2124;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    width: 100%;
}

/* We'll restrict photo height on larger screens below */
@media (min-width: 769px) {
    .photo-container {
        max-height: 60vh;
    }
}

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

.fullscreen-btn {
    position: absolute;
    z-index: 200;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 52px;
    color: #aaa;
    transition: color 0.3s;
    top: 48px;
    right: 2px;
}

.fullscreen-btn:hover {
    background: none;
    color: #00ffff;
}

/* Single icon style */
.fullscreen-icon::before {
    content: "⛶"; /* Fullscreen icon */
}

.vote-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.message {
    margin-top: 10px;
    color: #00ff00;
}

#allNotesContainer {
    font-size: 10pt;
    line-height: 1.2;
    color: #ccc;
    padding: 5px;
    max-height: 150px;
    overflow-y: auto;
    border-top: 1px solid #333;
    margin-top: 10px;
    text-align: left;
    /* Align all text to the left */
}

#results-links {
    padding-right: 5px;
    padding-top: 20px;
    bottom: 10px;
    right: 0;
    text-align: right;
}

#votedOverlay {
    /* position: absolute; */
    /* bottom: 2.2em; */
    /* right: 0; */
    color: #00ff00;
    /* Green text for the checkmark */
    margin-top: -27px;
    margin-bottom: -5px;
    height: 22px;
    font-size: 14pt;
    font-weight: 600;
    text-align: center;
    z-index: 160;
    text-shadow: 0 0 8px #000;
    /* Hidden by default */
    display: none;
}

#voteTotalsOverlay {
    position: absolute;
    opacity: 0.5;
    bottom: 5px;
    left: 5px;
    background: #000;
    color: #fff;
    padding: 4px 8px;
    font-size: 1vw;
    border-radius: 5px;
    text-align: left;
    z-index: 210;
    min-width: 99px;
    text-align: left;
    /* Ensure it appears above the photo */
}

#voteTotalsOverlay:before {
    content: "Total Votes";
    margin-bottom: 1em;
    display: block;
}

@media (max-width: 768px) {
    #voteTotalsOverlay{
        left: 20px;
        min-width: unset;
        font-size: 10px;
    }
}

#allNotesContainer p {
    margin: 2px 0;
    padding: 0;
}


/* Current album name */

h2.currentAlbum {
    font-weight: 500;
    color: #3a4346;
}

h2.currentAlbum a {
    color: #00bcd4;
    text-decoration: none;
    transition: color .2s;
}

h2.currentAlbum a:hover {
    color: #00ffff;
}

/* Photo title dropdown */
#photoTitle {
    width: 300px;
    padding: 10px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #00bcd4;
    background-color: #1e2124;
    color: #f9f9f9;
    margin-bottom: 20px;
    cursor: pointer;
}

#photoTitle:hover {
    opacity: 0.8;
}

.zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: zoom-out;
}

.zoom-overlay img {
    max-width: 98vw;
    max-height: 98vh;
    object-fit: contain;
}

/* Note entry field */
#notesInput {
    width: 150px;
    padding: 6px;
    font-size: 10pt;
    border-radius: 8px;
    border: 1px solid #00bcd4;
    background-color: #1e2124;
    color: #f9f9f9;
}

/* Modal styles */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #1e2124;
  color: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.modal-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-btn.filterActive {
  background-color: #00bcd4;
  color: #fff;
}

/* Responsive adjustments for mobile devices */
@media (max-width: 768px) {
    button.fullscreen-btn {
        top: 72px;
    }
    
    .container {
        display: flex;
        flex-direction: column;
        padding: 20px;
    }

    /* Move the sidebar to the top and make it full width */
    .sidebar {
        order: 1;
        width: 100%;
        margin-bottom: 10px;
    }

    /* Format the vote counts horizontally */
    .sidebar ul {
        display: flex;
        justify-content: space-around;
        width: 100%;
        padding: 0;
    }

    .sidebar li {
        margin-bottom: 0;
        font-size: 14px;
    }

    /* Main content below the votes */
    .main-content {
        order: 2;
    }

    /* Ensure controls fill available width */
    #userSelect,
    #photoTitle {
        width: 100%;
    }

    .buttons,
    .vote-buttons {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Adjust photo container height to ensure note field and button are visible */
    .photo-container {
        max-height: 40vh;
        width: 100%;
        position: relative;
    }

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