:root {
    --bg: #121212;
    --fg: #e0e0e0;
    --accent: #8b5cf6;
    --card-bg: #1e1e1e;
    --border: #333;
}

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: var(--bg);
    color: var(--fg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: var(--card-bg);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

header h1 {
    margin: 0 0 0.5rem;
    color: var(--accent);
    font-size: 1.8rem;
    padding-bottom: 0.5rem;
}

nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

nav a {
    color: var(--fg);
    text-decoration: none;
    font-weight: bold;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}

nav a:hover {
    background: var(--accent);
    color: white;
}

nav a.active {
    background: var(--accent);
    color: white;
}

.card h2 {
    margin: 0 0 1rem;
    color: var(--accent);
    font-size: 1.5rem;
    text-align: center;
}

main {
    padding: 2rem;
    max-width: calc(1200px + (2rem * 3));
    margin: auto;
  
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

@media (max-width: 1400px) {
    main {
        grid-template-columns: repeat(3, 1fr);
        padding: 1rem;
    }
}

@media (max-width: 1200px) {
    main {
        grid-template-columns: repeat(2, 1fr);
        padding: 1rem;
    }
}

@media (max-width: 800px) {
    main {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
}

.card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    height: fit-content;
    max-width: 450px;
    min-height: 200px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

span.card-footer {
    font-size: 0.8rem;
    color: #888;
    margin-top: auto;
    text-align: center;
}

.card-content {
    flex-grow: 1; /* Allow content to grow and fill space */
    display: flex;
    flex-direction: column; /* Stack content vertically */
    justify-content: center; /* Center vertically */
}

.card-img {
    width: 100%;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    object-fit: cover;
}

.danger {
    border: 2px solid #f44336;
}

.danger h2 {
    color: #f44336;
}

.warning {
    border: 2px solid #ff9800;
}

.warning h2 {
    color: #ff9800;
}

.success {
    border: 2px solid #4caf50;
}

.success h2 {
    color: #4caf50;
}

a.card {
    text-decoration: none;
    color: inherit;
}

.interactive {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.interactive:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    transform: scale(1.02);
    background-color: #1d1d1d;
}

footer {
    text-align: center;
    font-size: 0.9rem;
    color: #888;
}

.btn {
    display: inline-block;
    margin-top: 1.5rem;
    background: var(--accent);
    color: white;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 0.6rem;
    text-decoration: none;
    width: 80%;
    text-align: center;
    font-weight: bold;
    transition: background 0.2s, transform 0.1s;
}

.btn-group .btn {
    width: auto;
    flex: 1;
}

.btn-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn:active {
    transform: translateY(2px);
}

.btn:hover {
    background: #a78bfa;
    transform: translateY(-2px);
}

.btn-danger:hover {
    background: #e57373;
}
.btn-warning:hover {
    background: #ffb74d;
}
.btn-success:hover {
    background: #81c784;
}
.btn:disabled {
    background: #555;
    cursor: not-allowed;
}

/* Forms */

/* Form container to wrap the entire form */
.form-container {
    max-width: 600px; /* Limit the form width */
    margin: 2rem auto; /* Center the form */
    padding: 2rem;
    background: var(--card-bg); /* Match the card background */
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
}

/* Form group for individual input fields */
.form-group {
    margin-bottom: 1.5rem; /* Add spacing between fields */
    display: flex;
    flex-direction: column;
}

/* Label styling */
.form-group label {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--fg);
}

/* Input and textarea styling */
.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.8rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg);
    color: var(--fg);
    outline: none;
    transition: border-color 0.2s;
}

/* Checkboxes */
.form-group input[type="checkbox"] {
    width: auto; /* Adjust width for checkboxes */
    margin-right: 0.5rem; /* Add spacing between checkbox and label */
}

/* Focus state for inputs */
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
}

/* Button alignment */
.form-actions {
    display: flex;
    justify-content: flex-end; /* Align buttons to the right */
    gap: 1rem; /* Add spacing between buttons */
}

/* Hide the default file input */
.form-group input[type="file"] {
    display: none; /* Completely hide the default file input */
}

/* Style the custom file upload button */
.custom-file-upload {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    background: var(--accent);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, transform 0.1s;
}

/* Hover and active states for the button */
.custom-file-upload:hover {
    background: #a78bfa;
}

.custom-file-upload:active {
    transform: translateY(2px);
}

/* Table container for responsiveness */
.table-container {
    overflow-x: auto; /* Enable horizontal scrolling for small screens */
    margin: 2rem 0; /* Add spacing around the table */
}

.form-group select {
    padding: 0.8rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg);
    color: var(--fg);
    outline: none;
    transition: border-color 0.2s;
}

.form-group select:focus {
    border-color: var(--accent);
}

/* Base table styling */
table {
    width: 100%; /* Full width of the container */
    border-collapse: collapse; /* Remove gaps between cells */
    background: var(--card-bg); /* Match the card background */
    border: 1px solid var(--border); /* Add a border around the table */
    border-radius: 0.5rem; /* Optional: Rounded corners */
    overflow: hidden; /* Ensure rounded corners apply */
}

/* Table header styling */
table th {
    background: var(--accent); /* Accent color for the header */
    color: white; /* White text for contrast */
    text-align: left; /* Align text to the left */
    padding: 1rem; /* Add padding inside cells */
    font-weight: bold;
    font-size: 1rem;
}

/* Table body styling */
table td {
    padding: 1rem; /* Add padding inside cells */
    border-top: 1px solid var(--border); /* Add a border between rows */
    color: var(--fg); /* Text color */
    font-size: 0.9rem;
}

/* Zebra striping for rows */
table tr:nth-child(even) {
    background: #1d1d1d; /* Slightly darker background for even rows */
}

/* Hover effect for rows */
table tr:hover {
    background: #2a2a2a; /* Highlight row on hover */
}

/* Align numeric data to the right */
table td.numeric {
    text-align: right;
}