/* MAIN COLORS:
   • Navy background (very dark, almost #010B17)
   • Maroon highlight (#B22222)
   • Lime-green accent (#A4C639) for hovers/buttons
*/

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: url("../images/background.png") no-repeat center center fixed;
    background-size: cover;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: #eee;
    min-height: 100vh;
    position: relative;
    background-color: #010B17;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(1, 11, 23, 0.85);
    z-index: 0;
}

header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 1rem 0;
    background-color: #010B17;
    border-bottom: 2px solid #B22222;
}

header h1 {
    margin: 0;
    color: #f5f5f5;
    font-size: 2rem;
    letter-spacing: 1px;
}

header nav {
    margin-top: 0.5rem;
}

header nav a {
    color: #A4C639;
    margin: 0 1rem;
    text-decoration: none;
    font-weight: bold;
}

header nav a:hover {
    color: #8FAF2F;
}

main {
    position: relative;
    z-index: 1;
    padding: 2rem;
}

footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 1rem 0;
    background-color: #010B17;
    border-top: 1px solid #B22222;
}

h2 {
    margin-bottom: 0.75rem;
    font-size: 1.75rem;
}

.tile-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.tile {
    position: relative;
    width: 300px;
    height: 180px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tile-label {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(1, 11, 23, 0.85);
    color: #f5f5f5;
    padding: 0.5rem 0;
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
}

.tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
}

.tile:hover .tile-label {
    background: rgba(178, 34, 34, 0.9);
}

.back-button {
    display: inline-block;
    margin-top: 1rem;
    background-color: #A4C639;
    color: #010B17;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.back-button:hover {
    background-color: #8FAF2F;
}

.flash-container {
    max-width: 600px;
    margin: 1rem auto;
    position: relative;
    z-index: 2;
}

.flash {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.25rem;
    font-weight: bold;
    transition: opacity 0.5s ease; /* Added for fade effect */
}

.flash.success {
    background-color: #A4C639;
    color: #010B17;
}

.flash.error {
    background-color: #B22222;
    color: #fff;
}

/* Styles for Forms (Login, MFA, Admin) */
.cutoff-section {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.cutoff-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .cutoff-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.cutoff-form-container {
    background-color: #010B17;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    color: #eee;
}

.login-form-container {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    background-color: #010B17;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    color: #eee;
}

.admin-form-container {
    max-width: 800px; /* Increased from 600px */
    width: 100%;
    margin: 0 auto;
    background-color: #010B17;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    color: #eee;
}

.cutoff-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-heading {
    font-size: 1.5rem;
    font-weight: bold;
    color: #A4C639;
    text-align: center;
    margin-bottom: 0.75rem;
}

.form-instructions {
    font-size: 0.875rem;
    color: #ccc;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    max-width: 100%;
    word-wrap: break-word;
}

.form-instructions ol {
    margin: 0;
    padding-left: 1.5rem;
}

.form-instructions strong {
    font-weight: 600;
    color: #f5f5f5;
}

.form-group {
    position: relative;
    max-width: 100%;
}

.form-group label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #ccc;
    margin-bottom: 0.25rem;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid #B22222;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    background-color: #020d1a;
    color: #eee;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #A4C639;
    outline: none;
    box-shadow: 0 0 0 2px rgba(164, 198, 57, 0.3);
}

.form-group input[type="datetime-local"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    background-color: #020d1a;
    color: #eee;
    opacity: 0;
    position: absolute;
    z-index: 2;
}

.datetime-picker-trigger {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid #B22222;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    background-color: #020d1a;
    color: #eee;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.datetime-picker-trigger:hover {
    border-color: #A4C639;
    background-color: #030f1d;
}

.datetime-picker-trigger:focus {
    border-color: #A4C639;
    outline: none;
    box-shadow: 0 0 0 2px rgba(164, 198, 57, 0.3);
}

.datetime-picker-trigger::after {
    content: '📅';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #A4C639;
}

.cutoff-form button {
    width: 100%;
    background-color: #A4C639;
    color: #010B17;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cutoff-form button:hover {
    background-color: #8FAF2F;
}

.cutoff-form button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(164, 198, 57, 0.3);
}

/* Admin Panel Table */
.admin-table {
    border-collapse: collapse;
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    margin-top: 0.75rem;
    color: #eee;
}

.admin-table th,
.admin-table td {
    padding: 0.25rem 0.5rem;
    text-align: left;
    word-wrap: break-word;
    border-bottom: 1px solid #B22222;
}

.table-header {
    background-color: #B22222;
    color: #f5f5f5;
}

.table-header th {
    font-weight: bold;
}

.table-row {
    background-color: #020d1a;
}

.table-row:nth-child(even) {
    background-color: #030f1d;
}

.table-row:hover {
    background-color: #04131f;
}

.inline-form {
    display: inline;
    margin-right: 0.5rem;
}

.inline-input {
    padding: 0.25rem;
    border: 1px solid #B22222;
    border-radius: 0.25rem;
    margin-right: 0.25rem;
    max-width: 100px;
    background-color: #020d1a;
    color: #eee;
}

.action-button {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.75rem;
    background-color: #A4C639;
    color: #010B17;
    margin-right: 0.25rem;
}

.action-button:hover {
    background-color: #8FAF2F;
}

.delete-button {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.75rem;
    background-color: #B22222;
    color: #fff;
}

.delete-button:hover {
    background-color: #a01e1e;
}

/* MFA QR Code */
.mfa-qr {
    max-width: 200px;
    display: block;
    margin: 0.75rem auto;
}
