/* assets/style.css */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --bg-gray: #f3f4f6;
    --text-main: #1f2937;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --success-light: #d1fae5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 2.5rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

h1,
h2,
h3 {
    margin-top: 0;
    color: var(--text-main);
}

h1 {
    font-size: 2rem;
    font-weight: 700;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h3::before {
    content: "▸";
    color: var(--primary);
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    box-sizing: border-box;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: #fafafa;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 0 0 3px var(--primary-light);
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover {
    border-color: var(--primary);
}

button,
.btn {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

button:hover,
.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

button:active,
.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: #6b7280;
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.2);
}

.btn-secondary:hover {
    background-color: #4b5563;
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3);
}

.btn-danger {
    background-color: #ef4444;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th,
td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: var(--bg-gray);
    font-weight: 600;
}

.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border-left: 4px solid var(--success);
}

.flex {
    display: flex;
    gap: 1rem;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.text-right {
    text-align: right;
}

.font-bold {
    font-weight: bold;
}

/* Section divider */
hr {
    margin: 2.5rem 0;
    border: 0;
    border-top: 2px solid var(--border);
}

/* Print styles */
@media print {
    body {
        background: white;
    }

    .no-print {
        display: none;
    }

    .card {
        box-shadow: none;
        padding: 0;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }
}

/* Primary print button */
.btn-primary-print {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary-print:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

/* Print‑only elements */
.print-only {
    display: none;
}

@media print {
    .print-only {
        display: block;
    }

    /* Ensure primary button retains styling in print if needed */
    .btn-primary-print {
        background-color: var(--primary);
        color: black;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 1rem;
    }

    .card {
        padding: 1.5rem;
    }
}

/* === Admin Navigation === */
.admin-nav {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.admin-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}

.admin-nav a:hover,
.admin-nav a.active {
    color: var(--primary);
}

/* === Inline Editing === */
.editable {
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
}

.editable:hover:not(.editing) {
    background-color: var(--primary-light);
}

.editable.editing {
    padding: 0;
    background-color: white;
}

.inline-edit-input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid var(--primary);
    border-radius: 0.25rem;
    font-family: inherit;
    font-size: inherit;
    box-sizing: border-box;
}

.inline-edit-input:focus {
    outline: none;
    border-color: var(--primary-hover);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.inline-edit-controls {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    justify-content: flex-end;
}

.inline-edit-controls button {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    min-width: auto;
    box-shadow: none;
}

.btn-inline-save {
    background-color: var(--success);
}

.btn-inline-save:hover {
    background-color: #059669;
}

.btn-inline-cancel {
    background-color: #6b7280;
}

.btn-inline-cancel:hover {
    background-color: #4b5563;
}

.editable.saving {
    opacity: 0.6;
    pointer-events: none;
}

.editable.saved {
    animation: fadeSuccess 1s ease-out;
}

@keyframes fadeSuccess {
    0% { background-color: var(--success-light); }
    100% { background-color: transparent; }
}

.editable.error {
    background-color: #fee2e2;
}

.error-message {
    color: #dc2626;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Accessibility focus indicator */
.editable:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}