body {
	background-color: black;
	margin: 0;
	padding: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.top {
	background-color: #FCECCB;
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: 200px;
	padding: 0 2%; /* slight edge padding */
}

.top > div {
	flex-basis: 12.5%; /* 1/8 of 100% */
	display: flex;
	justify-content: center;
	align-items: center;
}

.logo {
    flex-grow: 0;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 2rem; /* optional spacing around the logo */
}

.logo img {
    height: auto;
    max-height: 80px;
    width: auto;
    object-fit: contain;
}


.nic1 img,
.nic2 img {
	height: 150px;
	max-width: 100%;
}

.container {
	flex: 1; /* This makes the container take up remaining space */
	margin-bottom: 20px; /* Add some space before footer */
}

.options1 {
	display: flex;
	justify-content: space-around; /* Distributes items evenly with space around them */
	align-items: center; /* Vertically centers the items */
	margin-bottom: 20px;
}

.options1 h1 {
	color: white;
	font-size: x-large;
	margin: 0 20px; /* Add some horizontal spacing between items */
	cursor: pointer; /* Makes them look clickable if you plan to add functionality */
}

.options2 {
	display: flex;
	justify-content: space-around; /* Distributes items evenly with space around them */
	align-items: center; /* Vertically centers the items */
	margin-bottom: 20px;
}

.options2 h1 {
	color: white;
	font-size: x-large;
	margin: 0 20px; /* Add some horizontal spacing between items */
	cursor: pointer; /* Makes them look clickable if you plan to add functionality */
}

.container h1 {
	color: white;
	font-size: x-large;
	/* Removed height: 100px; - this was forcing them to stack */
}

.container > h1 {
	/* This targets h1 directly under container (not in options) */
	height: 100px;
}

.table-container {
	color: white;
	font-size: medium; /* Reduced from large to fit more columns */
	margin-bottom: 50px;
	max-width: 95%; /* Increased from 80% to accommodate more columns */
	margin-left: auto;
	margin-right: auto; /* Center the table */
	overflow-x: auto; /* Allow horizontal scrolling if needed */
}

.table-container table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 0;
    padding-top: 0;
	table-layout: auto; /* Changed from fixed to auto for better column sizing */
	min-width: 1300px; /* Increased minimum width for additional column */
}

.table-container th,
.table-container td {
	padding: 6px 8px; /* Reduced padding to fit more columns */
	border: 1px solid #333;
	text-align: center; /* Center align for ratings */
	word-wrap: break-word; /* Handle long titles */
	overflow: hidden;
	white-space: nowrap; /* Prevent text wrapping in cells */
}

/* ID column */
.table-container th:nth-child(1),
.table-container td:nth-child(1) {
	min-width: 50px;
	font-weight: bold;
	color: #ccc;
}

/* Title column - left align and allow more width */
.table-container th:nth-child(2),
.table-container td:nth-child(2) {
	text-align: left;
	min-width: 200px;
	max-width: 300px;
	white-space: normal; /* Allow wrapping for titles */
}

/* Year column */
.table-container th:nth-child(3),
.table-container td:nth-child(3) {
	min-width: 60px;
}

/* Rated column */
.table-container th:nth-child(4),
.table-container td:nth-child(4) {
	min-width: 70px;
	color: #ffa500; /* Orange color for rating */
	font-weight: bold;
}

/* Pick column */
.table-container th:nth-child(5),
.table-container td:nth-child(5) {
	min-width: 60px;
}

/* Date column */
.table-container th:nth-child(6),
.table-container td:nth-child(6) {
	min-width: 80px;
}

/* Rating columns (tyler, alexb, trevor, jordan, drew, alexd, colin, other) */
.table-container th:nth-child(n+7):nth-child(-n+14),
.table-container td:nth-child(n+7):nth-child(-n+14) {
	min-width: 50px;
	font-weight: bold;
}

/* Average column - highlight it */
.table-container th:nth-child(15),
.table-container td:nth-child(15) {
	min-width: 60px;
	background-color: #444;
	font-weight: bold;
	color: #ffd700; /* Gold color for average */
}

.table-container th {
	background-color: #333;
	font-weight: bold;
	position: sticky;
	top: 0; /* Sticky header when scrolling */
	z-index: 10;
}

/* Hover effects for data rows */
.table-container tbody tr:hover {
	background-color: #222;
}

/* Error styling */
.error {
	color: #ff6b6b;
	background-color: #330000;
	padding: 10px;
	border-radius: 5px;
	margin: 20px;
	text-align: center;
}

.movie {
	height: 320px;
	padding: auto;
	position: relative;
}

.about {
    margin: 0 auto; /* Centers the element horizontally */
	display: flex;
    align-items: center;
    justify-content: center;
	color: #CC6633;
	font-size: 16px; /* Slightly larger font */
	font-weight: bolder;
	font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
	line-height: 1.6; /* Improved line spacing */
	flex: 1;
    width: fit-content; /* Shrinks to content size */
    max-width: 90vw; /* Prevents it from getting too wide on large screens */
	min-width: 250px;
    height: 300px;
	background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%); /* Subtle gradient */
    overflow-y: auto; /* Allow scrolling if text is too long */
	text-align: left;
	padding: 20px; /* More padding */
	border: 3px solid goldenrod;
    border-radius: 10px;
	box-sizing: border-box;
	position: relative;
}

.about p {
	margin: 0;
    text-align: center;
	margin: 0;
	text-indent: 0;
	font-weight: 400;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); /* Subtle text shadow for readability */
}

.buffer {
	height: 100px;
	padding: auto;
	position: relative;
}

.rating {
	width: 400px;
	height: 300px;
	padding: auto;
}

.rt, .rt2 {
	width: 200px;
    height: 275px;
    display: block;
    position: absolute;
    overflow: hidden;
	left: 600px;
	top: 0;
}

.rt2 {
	left: 900px;
}

.rt img, .rt2 img {
	position: relative;
    top: 0;
    left: 0;
    width: 100%;
}

.rt:hover, .rt2:hover {
	transform: scale(1.25);
}

.menu {
	height: auto;
	min-height: 100px;
}

.menu ul {
	list-style-type: none;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background-color: #333;
	display: flex;
	flex-wrap: wrap;
    justify-content: center;
}

.menu li {
	font-size: 25px;
	font-weight: bold;
}

.menu li a {
	display: block;
	color: #CC6633;
	text-align: center;
	padding: 28px 32px;
	text-decoration: none;
}

.menu a:visited {
	color: #CC6633;
}

.menu a:hover {
	background-color: #111;
}

footer {
	text-align: center;
	padding: 20px 3px;
	background-color: slategray;
	color: wheat;
	margin-top: auto; /* This pushes footer to bottom */
	clear: both;
	position: relative;
	z-index: 1000; /* Ensure footer is on top */
}

/* Sort Controls Styling */
.sort-controls {
    margin: 20px 0;
    padding: 15px;
    background: #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
	justify-content: center;
}

.sort-toggle-btn, .random-movie-btn {
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sort-toggle-btn {
    background: #4CAF50;
    color: white;
}

.sort-toggle-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.random-movie-btn {
    background: #FF6B35;
    color: white;
}

.random-movie-btn:hover {
    background: #E55A30;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.sort-toggle-btn:active, .random-movie-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sort-indicator {
    color: #45a049;
    font-size: 18px;
	font-weight: bold;
}

.sort-indicator strong {
    color: #333;
}

/* Movie Popup Styles */
.movie-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.movie-popup {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
}

.popup-header {
    background: #4CAF50;
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.popup-header.error {
    background: #f44336;
}

.popup-header h3 {
    margin: 0;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.popup-body {
    padding: 25px;
}

.movie-info {
    margin-bottom: 20px;
}

.movie-field {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.movie-field:last-child {
    border-bottom: none;
}

.movie-field strong {
    color: #333;
    display: inline-block;
    min-width: 100px;
}

.movie-field span {
    color: #666;
}

.popup-actions {
    text-align: center;
    margin-top: 20px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive design for mobile */
@media (max-width: 600px) {
    .sort-controls {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .sort-toggle-btn, .random-movie-btn {
        justify-content: center;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .movie-popup {
        width: 95%;
        margin: 10px;
    }
    
    .popup-body {
        padding: 20px;
    }
    
    .movie-field strong {
        min-width: 80px;
        font-size: 14px;
    }
}