/* Container & Cards */
.app-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    padding: 50px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.app-card {
    background: var(--panel-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    width: 350px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-accent);
    box-shadow: 0 0 20px rgba(15, 255, 213, 0.15);
}

.app-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.app-card h2 {
    color: var(--primary-accent);
    margin-bottom: 10px;
    font-size: 1.5rem;
    text-transform: uppercase;
}

.app-card p {
    color: var(--text-medium);
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Status & Buttons */
.status-container {
    margin-bottom: 20px;
    padding: 5px 15px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.status-pending { color: #f1c40f; border: 1px solid #f1c40f; }
.status-approved { color: #2ecc71; border: 1px solid #2ecc71; }
.status-rejected { color: #e74c3c; border: 1px solid #e74c3c; }
.status-none { color: #95a5a6; }

.app-btn {
    background: transparent;
    color: var(--primary-accent);
    border: 1px solid var(--primary-accent);
    padding: 10px 25px;
    border-radius: 5px;
    font-weight: 700;
    width: 100%;
    transition: all 0.3s;
    cursor: pointer;
}

.app-btn:hover:not(:disabled) {
    background: var(--primary-accent);
    color: #000;
    box-shadow: 0 0 15px var(--primary-accent);
}

.app-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #555;
    color: #555;
}

.history-btn {
    background: transparent;
    color: var(--text-medium);
    border: 1px solid var(--text-medium);
    padding: 8px 25px;
    border-radius: 5px;
    font-weight: 600;
    width: 100%;
    margin-top: 10px;
    transition: all 0.3s;
    cursor: pointer;
    font-size: 0.85rem;
}

.history-btn:hover {
    border-color: var(--text-light);
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

/* History Modal */
.history-modal-content {
    max-width: 600px;
    width: 95%;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: block; /* Changed from flex to block for nested details */
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-accent);
}

.history-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
}

.toggle-icon {
    color: var(--primary-accent);
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.history-details {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
}

/* Admin Notes Styling */
.history-notes-container {
    background: rgba(231, 76, 60, 0.1);
    border-left: 3px solid #e74c3c;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.notes-label {
    color: #e74c3c;
    font-weight: 800;
    font-size: 0.8rem;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.history-notes-content {
    color: #ffcece;
    font-style: italic;
    line-height: 1.4;
}

/* Q&A Styling in History */
.history-qa-block {
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 12px;
}

.history-question {
    color: var(--primary-accent);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.history-answer {
    color: #ddd;
    font-size: 0.95rem;
    padding-left: 10px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    white-space: pre-wrap;
}

.history-date {
    color: #aaa;
    font-size: 0.9rem;
}

.history-status {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Modal Form */
.app-modal-content {
    max-width: 800px;
    width: 95%;
}

.quota-alert {
    background: rgba(255, 165, 0, 0.15);
    border: 1px solid orange;
    color: orange;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: none; /* Managed by JS show/hide, but nice to have default */
}

/* Form Inputs */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #fff;
    font-weight: 600;
}

.required-mark {
    color: #db4437;
}

.form-help {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 5px;
    display: block;
}

.form-control {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--primary-accent);
    outline: none;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-label {
    margin: 0;
    font-weight: 400;
}

.checkbox-wrapper input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-accent);
}

/* Utility Classes */
.hidden { display: none !important; }
.text-center { text-align: center; }
.error-text { color: red; }

/* Fix for Application Form Overflow */
#applicationForm {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-grow: 1;
    min-height: 0;
}

#questionsContainer {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 10px;
    margin-bottom: 20px;
}

#questionsContainer::-webkit-scrollbar {
    width: 8px;
}

#questionsContainer::-webkit-scrollbar-track {
    background: #222;
    border-radius: 4px;
}

#questionsContainer::-webkit-scrollbar-thumb {
    background: #00ffd5;
    border-radius: 4px;
}

/* History Details Modal Styling (Admin-like) */
.review-modal-content {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 30px;
}

.review-modal-content .modal-title {
    margin-bottom: 25px;
    text-align: center;
}

.review-meta {
    background: rgba(255,255,255,0.05);
    padding: 18px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    gap: 15px;
    width: calc(100% - 5px);
    box-sizing: border-box;
}

.meta-date {
    color: #bbb;
    font-size: 0.9rem;
}

.meta-status {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    padding: 6px 14px;
    border-radius: 5px;
}

.review-content-area {
    text-align: left;
    overflow-y: auto;
    margin-bottom: 25px;
    padding-right: 5px;
    flex-grow: 1;
    width: 100%;
    box-sizing: border-box;
}

.review-content-area::-webkit-scrollbar {
    width: 8px;
}

.review-content-area::-webkit-scrollbar-track {
    background: #222;
    border-radius: 4px;
}

.review-content-area::-webkit-scrollbar-thumb {
    background: #00ffd5;
    border-radius: 4px;
}

.answer-block {
    background: rgba(16, 24, 32, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    width: calc(100% - 5px);
    box-sizing: border-box;
}

.question-text {
    background: rgba(15, 255, 213, 0.08);
    color: var(--primary-accent);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 14px 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(15, 255, 213, 0.15);
}

.answer-text {
    color: #f0f0f0;
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-wrap;
    padding: 18px 20px;
    background: transparent;
    word-break: break-word;
}

.notes-label {
    display: block;
    margin-top: 25px;
    margin-bottom: 12px;
    color: var(--primary-accent);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#historyAdminNotesContainer {
    width: calc(100% - 5px);
    box-sizing: border-box;
}

.admin-notes-textarea {
    width: 100%;
    margin-bottom: 25px;
    min-height: 100px;
    background: rgba(0,0,0,0.4);
    color: #f0f0f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    box-sizing: border-box;
    resize: none;
}