/* General Body Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Main container for centering content */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
}

/* Header */
.site-header {
    background: #fff;
    padding: 20px 0;
    text-align: center;
    border-bottom: 1px solid #ddd;
}
.site-header img {
    max-width: 250px;
    height: auto;
}

/* Navigation Bar */
.topnav {
    background-color: #333;
    overflow: hidden;
    border-radius: 5px;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.topnav a {
    display: block;
    color: #f2f2f2;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    font-size: 17px;
    transition: background-color 0.3s, color 0.3s;
}
.topnav a:hover {
    background-color: #ddd;
    color: black;
}
.topnav a.active {
    background-color: #af341a;
    color: white;
}

/* Main Content Area */
.main-content {
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
    font-size: 0.9em;
    color: #777;
}

/* --- Reusable Component Styles --- */

/* Forms */
input[type="text"],
input[type="password"],
textarea,
select {
    width: 95%;
    max-width: 400px;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

input[type="submit"] {
    background-color: #af341a;
    color: white;
    padding: 12px 20px;
    margin: 8px 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}
input[type="submit"]:hover {
    background-color: #9c2e17;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}
table, th, td {
    border: 1px solid #ddd;
}
th, td {
    padding: 12px;
    text-align: left;
}
th, .sus {
    background-color: #970400 !important;
    color: white;
    font-weight: bold;
}

/* Links */
a {
    color: #af341a;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Search Form Styles */
.search-form-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #dee2e6;
}
.search-form-container input[type="text"] {
    width: 80%;
    max-width: 600px;
    margin-bottom: 15px;
}
.search-options {
    margin-bottom: 15px;
    color: #555;
}
.search-options label {
    margin: 0 15px;
}

/* Card Grid Layout */
.results-container {
    margin-top: 20px;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Individual Card Styles */
.application-card {
    border: 1px solid #ddd;
    border-left-width: 5px;
    border-radius: 8px;
    padding: 15px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}
.application-card h3 {
    margin-top: 0;
    font-size: 1.25em;
    color: #333;
}
.application-card p {
    margin: 5px 0;
    color: #555;
}
.card-status {
    font-weight: bold;
    margin: 10px 0;
    padding: 5px 10px;
    border-radius: 5px;
    color: white;
    text-align: center;
}
.card-comment {
    font-style: italic;
    color: #666;
    flex-grow: 1; /* Pushes the button to the bottom */
}
.card-link {
    display: block;
    background-color: #af341a;
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 10px;
    transition: background-color 0.3s;
}
.card-link:hover {
    background-color: #9c2e17;
    text-decoration: none;
}

/* --- Status Color Indicators --- */
.status-pending { border-left-color: #ffc107; }
.status-pending .card-status { background-color: #ffc107; }

.status-testlink, .status-permlink { border-left-color: #28a745; }
.status-testlink .card-status, .status-permlink .card-status { background-color: #28a745; }

.status-declined, .status-rejected, .status-delinked { border-left-color: #dc3545; }
.status-declined .card-status, .status-rejected .card-status, .status-delinked .card-status { background-color: #dc3545; }

.status-cancelled { border-left-color: #6c757d; }
.status-cancelled .card-status { background-color: #6c757d; }

.status-prevote { border-left-color: #17a2b8; }
.status-prevote .card-status { background-color: #17a2b8; }

/* Notification Badge */
.notification-badge {
    background-color: red;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8em;
    vertical-align: top;
    margin-left: 4px;
}

/* Style for the delete link to make it stand out */
.delete-link {
    color: #dc3545 !important; /* A strong red color */
    font-weight: bold;
    background-color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #dc3545;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}
.delete-link:hover {
    background-color: #dc3545;
    color: white !important;
    text-decoration: none;
}