/* Change this generic button style */
button {
    padding: 8px 16px;
    background-color: blue;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background-color: darkblue;
}

/* TO THIS - more specific selectors */
body button:not(.admin-toggle-btn):not(.menu-toggle):not(.close-btn) {
    padding: 8px 16px;
    background-color: blue;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

body button:not(.admin-toggle-btn):not(.menu-toggle):not(.close-btn):hover {
    background-color: darkblue;
}
.login-row {
    text-align: center;
    padding: 10px;
}

.login-row a {
    color: blue;
    text-decoration: none;
}

.login-row a:hover {
    text-decoration: underline;
}
.login-form {
    width: 300px;
    margin: 50px auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 8px;
    margin: 6px 0;
    display: inline-block;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

.login-form button {
    background-color: #4CAF50;
    color: white;
    padding: 14px 20px;
    margin: 8px 0;
    border: none;
    cursor: pointer;
    width: 100%;
}

.login-form button:hover {
    opacity: 0.8;
}

.login-form p {
    text-align: center;
}

.login-link {
    margin-left: 20px; /* Ensures some space between the nav and login link */
    align-self: flex-end; /* Aligns the login link to the right of its container */
    text-align: right; /* Text aligned to the right */
}

.login-link a {
    text-decoration: none;
    color: blue;
    font-weight: bold;
	padding: 5px 10px; /* Padding for better touch target size */
    border-radius: 5px; /* Rounded corners for aesthetics */
}

.login-link a:hover {
    text-decoration: underline;
	background-color: #f0f0f0; /* Light background on hover for visibility */
}


#logo {
    height: 300px;
    width: auto; /* Keeps the logo proportional */
}

.header-container {
    display: flex; /* Sets up a flexbox layout */
    align-items: flex-start; /* Align items to the top */
}

.logo-block {
    display: flex;
    align-items: center; /* Center align the logo vertically */
}

.menu-login-block {
    display: flex;
    flex-direction: column; /* Organize content vertically */
    margin-left: 20px; /* Space between logo and this block */
}

.login-section {
    margin-bottom: 20px; /* Ensures space between the login form and the menu */
}

nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: flex-start;
}

nav ul li {
    margin-right: 20px;
}

nav ul li a {
    text-decoration: none;
    color: black;
    font-weight: bold;
}


.login-section form {
    display: flex;
    flex-wrap: wrap; /* Wrap form elements */
}

.login-section input[type="text"],
.login-section input[type="password"] {
    margin-right: 5px; /* Space between inputs */
    padding: 8px;
    border: 1px solid #ccc;
}

.login-section button {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
}

.login-section button:hover {
    background-color: #45a049;
}

.login-section form button[type="submit"] {
    margin-right: 10px; /* Adds space to the right of the Login button */
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
}

.login-section form button[type="button"] {
    /* Padding, background, and other styles should be consistent with the submit button */
    padding: 8px 16px;
    background-color: #007BFF; /* Optional: Different color for Register button */
    color: white;
    border: none;
    cursor: pointer;
}


.login-section a.forgot-password {
    display: block; /* Places link on a new line under buttons */
    margin-top: 5px;
    color: blue;
    text-decoration: none;
}

.login-section a.forgot-password:hover {
    text-decoration: underline;
}

#gameContainer {
    display: flex;
    align-items: start; /* Aligns items at the top of the container */
    justify-content: center; /* Centers the items horizontally if there's extra space */
    width: 100%; /* Takes full width of its container */
}
.img-game {
    max-height: 150px;
    width: auto;
}
.game-board {
    display: grid;
    grid-template-rows: repeat(5, 100px); /* Fixing 5 rows each 100px tall */
    grid-auto-flow: column; /* Filling columns after rows are filled */
    grid-auto-columns: minmax(100px, 1fr); /* Minimum size of 100px, growing to fit available space */
    gap: 10px;
    justify-content: start; /* Align grid to the start of the game board */
    margin-top: 10px;
    width: max-content; /* Adjust width based on the content */
    margin: auto; /* Centering the game board horizontally */
}


.lobby {
    width: 100px; /* Fixed width for the lobby */
    padding: 10px;
    border-left: 2px solid #ccc;
    height: 100%; /* Adjust based on your layout */
}

.lobby h3 {
    margin-top: 0;
}

.lobby ul {
    list-style-type: none;
    padding: 0;
}
.card {
    width: 100px;  // Set the width of the card
    height: 100px; // Set the height of the card
    background-color: transparent;
    cursor: pointer;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    position: relative;
}

.card .front, .card .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background-size: cover;  // Ensures that the background image covers the entire area of the div
    background-position: center; // Centers the background image
}

.card .front {
    background: url('../../images/memorygame/back.jpg') no-repeat center center;
}

.card .back {
    transform: rotateY(180deg);
    background-size: contain; // Ensure the image fits within the card, change to 'cover' if you want it to fill the entire area
}

.card.flip {
    transform: rotateY(180deg);
}




/* Title Page Specific Styles - Optimized */
#content-area .title-page-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

#content-area .section {
    display: flex;
    align-items: flex-start; /* Align items to top */
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
    margin: 40px auto;
    padding: 20px;
    border-bottom: 1px solid #eee;
    box-sizing: border-box;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    gap: 30px; /* Space between image and content */
}

#content-area .section.reverse { 
    flex-direction: row-reverse; 
}

#content-area .image-container { 
    flex: 0 0 45%; /* Don't grow, don't shrink, base 45% */
    min-width: 300px;
    max-width: 500px;
    text-align: center;
    padding: 10px;
}

#content-area .image-container img {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: block;
}

#content-area .content-container { 
    flex: 1 1 45%; /* Take remaining space */
    min-width: 300px;
    padding: 10px;
    box-sizing: border-box;
}

/* Content row with side images and text block */
#content-area .content-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
    flex-wrap: nowrap; /* Prevent wrapping */
    min-height: 200px; /* Ensure minimum height */
}

#content-area .side-image {
    flex: 0 0 auto; /* Don't grow or shrink */
    text-align: center;
    display: flex;
    align-items: center; /* Center vertically */
    justify-content: center;
    min-height: 150px; /* Ensure side images have space */
}

#content-area .side-image img {
    width: 80px !important;
    height: auto !important;
    max-width: 80px !important;
    max-height: 200px !important;
    object-fit: contain;
}

#content-area .text-block {
    flex: 1 1 auto; /* Take available space */
    min-width: 200px;
    padding: 20px;
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#content-area .content-text {
    line-height: 1.6;
    font-size: 16px;
    color: #333;
    min-height: 100px; /* Ensure content has minimum height */
}

/* Admin form styles */
#content-area .admin-form {
    width: 100%;
}

#content-area .admin-form label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
    color: #333;
}

#content-area .admin-form textarea, 
#content-area .admin-form input[type=text] {
    width: 100%;
    margin-top: 5px;
    margin-bottom: 15px;
    padding: 10px;
    font-size: 14px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
}

#content-area .admin-form textarea {
    min-height: 120px;
    resize: vertical;
}

#content-area .admin-form button {
    margin: 5px 5px 0 0;
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#content-area .admin-form button[type="submit"]:not([name="delete_id"]) {
    background: #007bff;
    color: white;
}

#content-area .admin-form button[type="submit"]:not([name="delete_id"]):hover {
    background: #0056b3;
}

#content-area .admin-form button[type="submit"][name="delete_id"] {
    background: #dc3545;
    color: white;
}

#content-area .admin-form button[type="submit"][name="delete_id"]:hover {
    background: #c82333;
}

/* Add new section styles */
#content-area .add-new-section {
    text-align: center;
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

#content-area .add-new-section h3 {
    margin-bottom: 20px;
    color: #495057;
}

/* Responsive styles for title page */
@media (max-width: 1024px) {
    #content-area .section {
        gap: 20px;
    }
    
    #content-area .image-container {
        flex: 0 0 40%;
    }
    
    #content-area .content-container {
        flex: 1 1 55%;
    }
}

@media (max-width: 768px) {
    #content-area .section, 
    #content-area .section.reverse {
        flex-direction: column;
        margin: 20px auto;
        padding: 15px;
        gap: 20px;
    }
    
    #content-area .image-container, 
    #content-area .content-container {
        flex: 1 1 100%;
        min-width: auto;
        max-width: 100%;
        padding: 0;
    }
    
    #content-area .image-container img {
        max-height: 300px;
    }
    
    #content-area .content-row {
        flex-wrap: wrap; /* Allow wrapping on mobile */
        gap: 10px;
    }
    
    #content-area .side-image {
        order: -1;
        margin-bottom: 10px;
    }
    
    #content-area .side-image img {
        width: 60px !important;
        max-height: 150px !important;
    }
    
    #content-area .text-block {
        flex: 1 1 100%;
        min-width: auto;
        order: 1; /* Ensure text comes after side images */
    }
}

@media (max-width: 480px) {
    #content-area .section {
        padding: 10px;
        margin: 15px auto;
    }
    
    #content-area .image-container img {
        max-height: 250px;
    }
    
    #content-area .side-image img {
        width: 50px !important;
        max-height: 120px !important;
    }
    
    #content-area .title-page-content {
        padding: 10px;
    }
    
    #content-area .content-row {
        flex-direction: column;
        align-items: center;
    }
    
    #content-area .side-image {
        margin-bottom: 15px;
    }
}

		h2 {
			display: block;
			padding: 10px;
			background: #333;
			color: white;
			text-align: center;
		}

		table {
			width: 100%;
			border-collapse: collapse;
			background: white;
			table-layout: fixed; /* Ensures equal column widths */
		}

		th, td {
			padding: 8px;
			border: 1px solid #ddd;
			text-align: center;
			font-size: 16px;
			word-break: break-word;
			white-space: nowrap;
		}

		th {
			background-color: #333;
			color: white;
			font-size: 16px;
			border: none;
		}

		tr:nth-child(even) {
			background-color: #f2f2f2;
		}

		thead th {
			position: sticky;
			top: 0;
			background-color: #333; /* Keep same as your header color */
			z-index: 2; /* Ensure it stays above the cells when scrolling */
		}

		thead input {
			width: 95%;
			padding: 4px;
			font-size: 14px;
			box-sizing: border-box;
		}

		
		/* ✅ Set column widths */
		th:nth-child(1), td:nth-child(1) { width: 10%; } /* Name */
		th:nth-child(2), td:nth-child(2) { width: 10%; } /* Surname */
		th:nth-child(3), td:nth-child(3) { width: 12%; } /* Birthdate */
		th:nth-child(4), td:nth-child(4),
		th:nth-child(5), td:nth-child(5),
		th:nth-child(6), td:nth-child(6) { width: 8%; } /* Numerology Numbers */

		th:nth-child(7), td:nth-child(7),
		th:nth-child(8), td:nth-child(8),
		th:nth-child(9), td:nth-child(9),
		th:nth-child(10), td:nth-child(10),
		th:nth-child(11), td:nth-child(11),
		th:nth-child(12), td:nth-child(12),
		th:nth-child(13), td:nth-child(13) { width: 7%; } /* Cards */

		/* ✅ Fix Planetary Card column */
		th:nth-child(14), td:nth-child(14) { width: 7%; }

		/* ✅ Fix Birthdate alignment */
		td:nth-child(3) {
			white-space: nowrap;
			font-weight: bold;
		}

		/* ✅ Fix misalignment for Planetary Ruler */
		td:nth-child(13) {
			font-size: 18px; /* Bigger font for planet symbols */
		}
		
		table thead th {
    position: sticky;
    top: 0;
    background-color: #f9f9f9; /* Or any color that contrasts with the page */
    z-index: 10;
    border-bottom: 2px solid #ccc;
}

.sticky-table-wrapper {
    border: 1px solid #ccc;
    overflow: hidden;
}

.table-scroll {
    max-height: 600px;
    overflow-y: auto;
}

.sticky-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.sticky-table th,
.sticky-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: center;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ✅ Sticky header */
.sticky-table thead th {
    position: sticky;
    top: 0;
    background-color: #333;
    color: white;
    z-index: 10;
}


th.sorted-asc::after {
    content: " ▲";
}
th.sorted-desc::after {
    content: " ▼";
}

th.sortable {
	cursor: pointer;
	position: relative;
	user-select: none;
	transition: background-color 0.3s;
}

th.sortable:hover {
	background-color: #444 !important;
}



th.sorted-asc::after {
	content: " ▲";
	position: absolute;
	right: 5px;
}

th.sorted-desc::after {
	content: " ▼";
	position: absolute;
	right: 5px;
}


th.sortable.sorted-asc::after {
	content: " ▲";
	color: #444;
}

th.sortable.sorted-desc::after {
	content: " ▼";
	color: #444;
}

.admin-form textarea,
.admin-form input[type="text"] {
    width: 100%;
    margin-top: 8px;
    padding: 6px;
    font-size: 16px;
}
.admin-form button {
    margin: 10px 5px 0 0;
    padding: 8px 12px;
    font-size: 15px;
}

.section-columns {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

.content-row {
    display: flex;
    align-items: flex-start; /* prevent stretching */
    justify-content: space-between;
    gap: 20px;
    flex-wrap: nowrap;
}

.side-image {
    flex: 0 0 auto;
    text-align: center;
}

.side-image img {
    width: 100px !important;
    height: 700px !important;
    max-width: 100px !important;
    max-height: 700px !important;
    border: 2px solid red; /* visual test */
}


.text-block {
    flex: 1;
    padding: 15px;
    background-color: #fefefe;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1);
    
    overflow-y: auto;
	min-height: 100px; /* Prevent small blocks from collapsing */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.admin-form textarea {
    height: 180px !important;  /* Fix height inside CKEditor */
}


.notice-box {
    position: relative;
    padding: 12px 40px 12px 16px;
    margin: 20px auto;
    border-radius: 5px;
    max-width: 900px;
    font-size: 16px;
}

.notice-box.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notice-box.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.notice-box .close-btn {
    position: absolute;
    right: 10px;
    top: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    color: inherit;
}

ul#tournament-list li {
    list-style-type: none;
}
ul#tournament-list select,
ul#tournament-list button {
    font-size: 14px;
    padding: 4px 8px;
}

.tooltip-cell {
    position: relative;
    cursor: help;
}

.tooltip-cell::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 120%;
    left: 0;
    white-space: pre-line;
    background: #f8f8f8;
    color: #000;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    width: max-content;
    max-width: 300px;
    transition: opacity 0.2s;
}

.tooltip-cell:hover::after {
    opacity: 1;
}

details summary {
    cursor: pointer;
    font-weight: bold;
    color: #333;
}

details[open] summary {
    color: #0077cc;
}

details div {
    padding-left: 10px;
    margin-top: 5px;
    color: #222;
}

.remaining-list {
    padding-left: 20px;
    margin: 5px 0;
    font-size: 13px;
    text-align: left;
}
.remaining-list li {
    list-style-type: disc;
    margin-left: 15px;
}

/* Title Page Styles */
.title-page-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
    margin: 40px auto;
    padding: 20px;
    border-bottom: 1px solid #ccc;
    box-sizing: border-box;
}

.section.reverse { 
    flex-direction: row-reverse; 
}

.image-container { 
    flex: 1 1 45%;
    min-width: 300px;
    max-width: 500px;
    text-align: center;
    padding: 10px;
}

.image-container img {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border: 2px solid #ddd;
    border-radius: 8px;
}

.content-container { 
    flex: 1 1 40%;
    min-width: 300px;
    max-width: 600px;
    padding: 20px;
    box-sizing: border-box;
}

.content-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
    flex-wrap: wrap;
}

.side-image {
    flex: 0 0 auto;
}

.side-image img {
    width: 80px;
    height: auto;
}

.text-block {
    flex: 1 1 60%;
    min-width: 250px;
}

.content-text {
    line-height: 1.6;
    font-size: 16px;
}

.admin-form textarea, 
.admin-form input[type=text] {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    font-size: 16px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.admin-form button {
    margin: 10px 5px 0 0;
    padding: 10px 15px;
    font-size: 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Responsive styles */
@media (max-width: 768px) {
    .section, .section.reverse {
        flex-direction: column;
    }
    
    .image-container, .content-container {
        flex: 1 1 100%;
        min-width: auto;
        max-width: 100%;
    }
    
    .image-container img {
        max-height: 350px;
    }
    
    .content-row {
        flex-direction: column;
        align-items: center;
    }
    
    .side-image {
        order: -1;
        margin-bottom: 15px;
    }
    
    .text-block {
        flex: 1 1 100%;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 10px;
        margin: 20px auto;
    }
    
    .image-container img {
        max-height: 250px;
    }
    
    .side-image img {
        width: 60px;
    }
}

/* ===== REGISTRATION FORM STYLES ===== */
.register-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 80vh;
    margin: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)), 
                url('images/background.jpg'); 
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat; 
    background-attachment: fixed;
    padding: 15px;
    box-sizing: border-box;
    overflow-y: auto;
}

.register-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 480px;
    margin: auto;
}

.registration-input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    width: 100%;
}

.registration-input-group label {
    text-align: left;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
}

.registration-input-group input[type="text"], 
.registration-input-group input[type="email"], 
.registration-input-group input[type="password"], 
.registration-input-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
}

.registration-input-group input[type="submit"] {
    background-color: #333;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin: 10px auto 0;
    display: block;
    width: 100%;
    max-width: 200px;
}

.registration-input-group input[type="submit"]:hover {
    background-color: #555;
}

.registration-password-error {
    color: red;
    display: none;
    width: 100%;
    text-align: center;
    margin: 10px 0;
    font-size: 14px;
}

.registration-success-message {
    text-align: center; 
    padding: 40px 30px; 
    color: white; 
    background-color: #4CAF50; 
    font-size: 20px; 
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    margin: 50px auto;
    box-sizing: border-box;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    line-height: 1.6;
    font-weight: bold;
}

.registration-error-message {
    text-align: center; 
    padding: 15px; 
    color: white; 
    background-color: red; 
    font-size: 16px; 
    border-radius: 5px;
    width: 100%;
    margin: 20px auto;
    box-sizing: border-box;
}

/* Tablet responsive */
@media (min-width: 768px) {
    .register-form {
        padding: 30px;
        max-width: 700px;
    }
    
    .registration-input-group {
        flex-direction: row;
        align-items: center;
    }
    
    .registration-input-group label {
        flex-basis: 30%;
        text-align: right;
        margin-right: 15px;
        margin-bottom: 0;
    }
    
    .registration-input-group input[type="text"], 
    .registration-input-group input[type="email"], 
    .registration-input-group input[type="password"], 
    .registration-input-group select {
        flex-grow: 1;
        min-width: 300px;
    }
}

@media (min-width: 480px) {
    .register-form {
        padding: 30px;
        max-width: 700px;
    }
    
    .registration-input-group {
        flex-direction: row;
        align-items: center;
    }
    
    .registration-input-group label {
        flex-basis: 30%;
        text-align: right;
        margin-right: 15px;
        margin-bottom: 0;
    }
    
    .registration-input-group input[type="text"], 
    .registration-input-group input[type="email"], 
    .registration-input-group input[type="password"], 
    .registration-input-group select {
        flex-grow: 1;
        min-width: 50px;
    }
}