/*
 * THIS IS style.css
 * Contains all shared styles for the application.
 * Last Updated: 2025-10-01 01:06 PM (America/Toronto)
 */

/* --- General & Global Styles --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: #f8f9fa;
    color: #212529;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header, footer {
    padding: 10px 20px;
    background-color: #fff;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: #6c757d;
}

/* --- Header & Navigation --- */
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links a {
    margin-right: 15px;
    text-decoration: none;
    color: #0d6efd;
}

.auth-buttons a, .profile-link {
    text-decoration: none;
    padding: 8px 15px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    margin-left: 5px;
}

.auth-buttons .admin {
    border-color: #dc3545;
    color: #dc3545;
}

.auth-buttons .logout, .profile-link {
    border-color: #6c757d;
    color: #6c757d;
}

.logged-in-bar {
    background-color: #e9ecef;
    padding: 10px 20px;
    color: #495057;
    font-size: 0.9em;
    font-weight: bold;
}
.logged-in-bar a {
    color: #495057;
    text-decoration: none;
}
.logged-in-bar a:hover {
    text-decoration: underline;
}


/* --- Page Headers & Titles --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h1, h2 {
    margin: 0;
    display: inline-block;
    vertical-align: middle;
}

h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: #6c757d;
    margin-left: 10px;
}

/* --- Buttons & Badges --- */
.btn {
    display: inline-block;
    text-decoration: none;
    color: #fff;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

.btn-green { background-color: #198754; }
.btn-blue { background-color: #0d6efd; }
.btn-orange { background-color: #fd7e14; }
.btn-cyan { background-color: #0dcaf0; color: #000; }
.btn-grey { background-color: #6c757d; }

.status-badge {
    background-color: #ffc107;
    color: #000;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: bold;
}

/* --- Tables (General) --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    text-align: left;
}

thead {
    background-color: #212529;
    color: #fff;
}

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

tbody a {
    color: #0d6efd;
    text-decoration: none;
}

tbody a:hover {
    text-decoration: underline;
}

/* --- Forms (General) --- */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.form-grid {
    display: grid;
    gap: 15px;
}

.form-grid input, .form-grid textarea,
input[type="text"], input[type="password"], input[type="email"], textarea, select {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    box-sizing: border-box;
}

label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
}

/* --- Login & Utility Page Styles --- */
.login-card, .genpass-card, .profile-card {
    width: 100%;
    max-width: 450px;
    padding: 30px;
}
.result-box {
    background-color: #e9ecef;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    word-wrap: break-word;
}
.result-box strong {
    display: block;
    margin-bottom: 10px;
}

/* --- Index Page Styles --- */
.welcome-container {
    text-align: center;
    padding: 80px 20px;
}
.welcome-container h1 {
    font-size: 2.8rem;
    font-weight: 500;
    color: #111827;
    margin-bottom: 0.5em;
}
.welcome-container p {
    font-size: 1.2rem;
    color: #4B5563;
    margin-top: 0;
    margin-bottom: 50px;
}
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}
.action-btn {
    display: inline-block;
    background-color: #3B82F6;
    color: white;
    padding: 0.9rem 2.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s ease-in-out;
    min-width: 220px;
}
.action-btn:hover {
    background-color: #2563EB;
}

/* --- Modal Styles --- */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}
.modal-content {
    border-radius: 8px;
}
.modal-body {
    padding: 2rem;
}
/* Style for "Create New Order" Modal */
#createOrderModal .form-group {
    margin-bottom: 1rem;
}
#createOrderModal input {
    font-size: 1.1rem;
    padding: 10px;
}

/* --- AJAX Status Indicator --- */
#autosave-status {
    margin-right: 15px;
    font-weight: bold;
    transition: all 0.3s ease;
}
.status-saving { color: #fd7e14; }
.status-success { color: #198754; }
.status-error { color: #dc3545; }


/* --- Periodicals Desktop Table View --- */
.periodical-table {
    border: 1px solid #dee2e6;
}
.periodical-table th, .periodical-table td {
    padding: 8px;
    vertical-align: middle;
}
.periodical-table td input {
    border: 1px solid #ccc;
    padding: 6px;
    width: 100%;
    box-sizing: border-box;
}
.periodical-table .author-input {
    margin-bottom: 5px;
}
.periodical-table .year-vol-group {
    display: flex;
    gap: 5px;
}
.periodical-table .copies-input {
    max-width: 60px;
    text-align: center;
}
.periodical-table .text-center {
    text-align: center;
}
.special-instructions-row td {
    padding-top: 0;
}
.special-instructions-row label {
    font-size: 0.8em;
    font-weight: normal;
    margin-bottom: 2px;
}

/* --- Stacked "Phone" View (Periodicals & Monographs) --- */
.order-line-mobile {
    background-color: #fff;
    border: 1px solid #dee2e6;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.mobile-line-header {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}
.mobile-form-group {
    margin-bottom: 15px;
}
.mobile-form-group label {
    font-size: 0.85em;
    color: #495057;
}
.mobile-form-row {
    display: flex;
    gap: 15px;
}
.mobile-form-row > * {
    flex: 1;
}
.order-line-mobile textarea {
    min-height: 80px;
    resize: vertical;
}

/* --- Material Selection Modal Preview --- */
#book-preview {
    width: 250px;
    height: 350px;
    background-size: cover;
    background-position: center;
    position: relative;
    border: 1px solid #ccc;
    background-color: #e9ecef;
    background-image: none;
    display: flex;
    justify-content: center;
    align-items: center;
}
#preview-text {
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

