/* Custom Font */
@font-face {
    font-family: 'Jasper Daniels';
    src: url('/fonts/Jasper Daniels.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #2d2d2d;
    --primary-hover: #1a1a1a;
    --secondary-color: #555555;
    --secondary-hover: #444444;
    --danger-color: #2d2d2d;
    --danger-hover: #1a1a1a;
    --success-color: #2d2d2d;
    --success-hover: #1a1a1a;
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
    --font-main: 'Jasper Daniels', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* Mobile Background (default) */
body {
    position: relative;
    background-image: url('/images/background_mobile.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Desktop Background */
@media (min-width: 601px) {
    body {
        background-image: url('/images/background_desktop.jpg');
    }
}

/* ==================== */
/* HOME PAGE STYLES     */
/* ==================== */

.home-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 100vh;
    padding: 3rem 1.5rem;
}

.logo-container {
    margin-top: 2rem;
}

.logo {
    font-family: var(--font-main);
    font-size: 3rem;
    color: white;
    background: #2d2d2d;
    padding: 0.75rem 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.nav-btn {
    font-family: var(--font-main);
    font-size: 1.25rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
    min-width: 140px;
}

.nav-btn-dark {
    background: #2d2d2d;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-btn-dark:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
}

.tagline-container {
    margin-top: auto;
    margin-bottom: 2rem;
}

.tagline {
    font-family: var(--font-main);
    font-size: 1.1rem;
    color: #333;
    background: rgba(255, 255, 255, 0.85);
    padding: 0.75rem 2rem;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ==================== */
/* PAGE HEADER & BACK   */
/* ==================== */

.page-header {
    position: relative;
    text-align: center;
    margin-bottom: 1.5rem;
}

.back-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-main);
    font-size: 1rem;
    color: white;
    text-decoration: none;
    background: #2d2d2d;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.back-btn:hover {
    background: #1a1a1a;
    box-shadow: var(--shadow-lg);
}

/* ==================== */
/* CONTAINER & CARDS    */
/* ==================== */

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
    color: var(--text-color);
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    letter-spacing: 2px;
}

/* Form Card */
.form-card, .table-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

.form-card h3, .table-card h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    color: var(--text-color);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-main);
    transition: border-color 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2d2d2d;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* ==================== */
/* BUTTONS - B&W THEME  */
/* ==================== */

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #2d2d2d;
    color: white;
}

.btn-primary:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: #2d2d2d;
    border: 2px solid #2d2d2d;
}

.btn-secondary:hover {
    background: #f5f5f5;
}

.btn-danger {
    background: white;
    color: #2d2d2d;
    border: 2px solid #2d2d2d;
}

.btn-danger:hover {
    background: #2d2d2d;
    color: white;
}

.btn-success {
    background: #2d2d2d;
    color: white;
}

.btn-success:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.btn-icon {
    background: white;
    color: #2d2d2d;
    border: 2px solid #2d2d2d;
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #2d2d2d;
    color: white;
}

/* ==================== */
/* TABLE                */
/* ==================== */

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #2d2d2d;
    color: white;
}

th {
    padding: 0.85rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

th:first-child {
    border-radius: 8px 0 0 8px;
}

th:last-child {
    border-radius: 0 8px 8px 0;
}

td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
}

tbody tr:hover {
    background: rgba(45, 45, 45, 0.05);
}

.actions {
    display: flex;
    gap: 0.5rem;
}

/* ==================== */
/* EMPTY STATE          */
/* ==================== */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 2px dashed var(--border-color);
}

.empty-state p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ==================== */
/* SAVE SECTION         */
/* ==================== */

.save-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.save-section .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* ==================== */
/* MODAL                */
/* ==================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.modal p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* ==================== */
/* HISTORY PAGE         */
/* ==================== */

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border-color);
    overflow: hidden;
    transition: all 0.2s;
}

.history-card.expanded {
    border-color: #2d2d2d;
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
}

.history-card-header:hover {
    background: rgba(45, 45, 45, 0.05);
}

.history-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.history-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.expand-icon {
    margin-left: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.history-card-body {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

.history-card-body table {
    margin-top: 1rem;
}

.history-footer {
    margin-top: 2rem;
    text-align: center;
}

.empty-state a {
    color: #2d2d2d;
    font-weight: 600;
}

/* ==================== */
/* MOBILE - ADDITIONS   */
/* ==================== */

@media (max-width: 600px) {
    .save-section {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-actions {
        flex-direction: column;
    }

    .history-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .history-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ==================== */
/* SETTINGS BUTTON      */
/* ==================== */

.settings-container {
    margin-top: 1rem;
}

.nav-btn-light {
    background: rgba(255, 255, 255, 0.9);
    color: #2d2d2d;
    border: 2px solid #2d2d2d;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.nav-btn-light:hover {
    background: white;
    transform: translateY(-2px);
}

/* ==================== */
/* IMPORT/EXPORT        */
/* ==================== */

.import-export-actions {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.import-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-input-label {
    cursor: pointer;
}

.file-input {
    display: none;
}

.import-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.import-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
}

.import-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.import-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==================== */
/* AUTOCOMPLETE         */
/* ==================== */

.autocomplete-container {
    position: relative;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #2d2d2d;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f5f5f5;
}

.suggestion-name {
    font-weight: 500;
}

.suggestion-category {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--border-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* ==================== */
/* SETTINGS OPTIONS     */
/* ==================== */

.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.settings-option:last-child {
    border-bottom: none;
}

.settings-option-info {
    flex: 1;
}

.settings-label {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
    display: block;
}

.settings-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle input:checked + .toggle-slider {
    background-color: #2d2d2d;
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* ==================== */
/* INFO BANNER & HINTS  */
/* ==================== */

.info-banner {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.info-hint {
    margin-top: 1rem;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

/* ==================== */
/* MOBILE - SETTINGS    */
/* ==================== */

@media (max-width: 600px) {
    .settings-option {
        flex-direction: column;
        gap: 0.75rem;
    }

    .toggle {
        align-self: flex-start;
    }
}

/* ==================== */
/* LANGUAGE SELECT      */
/* ==================== */

.language-select {
    padding: 0.5rem 1rem;
    border: 2px solid #2d2d2d;
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 1rem;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.language-select:focus {
    outline: none;
    border-color: #1a1a1a;
}