@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow-y: auto;
}

body {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 17px;
    background: #1a1a1a;
    color: #e8e8e8;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    padding: 20px;
    padding-bottom: 20px;
}

.container {
    width: 100%;
}

.card {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 20px;
}

h1 {
    color: #f0f0f0;
    font-size: 17px;
    font-weight: normal;
    margin-bottom: 16px;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #3e3e42;
}

.header-row h1 {
    margin: 0;
}

.form-group {
    margin-bottom: 12px;
}

label {
    display: block;
    color: #a8a8a8;
    font-size: 17px;
    margin-bottom: 4px;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
textarea {
    width: 100%;
    padding: 8px;
    background: #222222;
    border: 1px solid #4a4a4a;
    color: #e8e8e8;
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 17px;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #007acc;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.btn-primary,
.btn-secondary {
    padding: 8px 16px;
    border: 1px solid #3e3e42;
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 17px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #0e639c;
    color: #ffffff;
    border-color: #0e639c;
}

.btn-primary:hover {
    background: #1177bb;
    border-color: #1177bb;
}

.btn-secondary {
    background: #3e3e42;
    color: #e0e0e0;
}

.btn-secondary:hover {
    background: #505050;
}

.success {
    background: #1e3a1e;
    border: 1px solid #3d6b3d;
    color: #8ce99a;
    padding: 10px;
    margin-bottom: 12px;
    font-size: 17px;
}

.error {
    background: #3a1e1e;
    border: 1px solid #6b3d3d;
    color: #ffa8a8;
    padding: 10px;
    margin-bottom: 12px;
    font-size: 17px;
}

.posting {
    display: grid;
    grid-template-columns: 1fr 150px 60px;
    gap: 8px;
    margin-bottom: 8px;
    align-items: end;
}

.posting-indent {
    padding-left: 32px;
}

#postings {
    margin-bottom: 12px;
}

.add-posting-btn {
    padding: 6px 12px;
    background: #3e3e42;
    color: #e0e0e0;
    border: 1px solid #3e3e42;
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 17px;
    cursor: pointer;
    margin-bottom: 12px;
}

.add-posting-btn:hover {
    background: #505050;
}

.remove-btn {
    padding: 6px;
    background: #5a2d2d;
    color: #ffa8a8;
    border: 1px solid #5a2d2d;
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 17px;
    cursor: pointer;
}

.remove-btn:hover {
    background: #6a3d3d;
}

/* Autocomplete dropdown */
.autocomplete-container {
    position: relative;
}

.autocomplete-items {
    position: absolute;
    border: 1px solid #4a4a4a;
    background: #2a2a2a;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-items div {
    padding: 8px;
    cursor: pointer;
    font-size: 17px;
    color: #e8e8e8;
}

.autocomplete-items div:hover,
.autocomplete-active {
    background: #1a4d7a;
}

.highlight {
    color: #5fd3bc;
    font-weight: bold;
}

/* Checkbox styling */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    html {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body {
        padding: 12px;
        padding-bottom: 0;
        min-height: auto;
        height: auto;
    }

    .card {
        margin-bottom: 0;
    }

    .form-group:last-child {
        margin-bottom: 0;
    }

    .btn-primary {
        margin-bottom: 0;
    }

    .posting {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .posting-indent {
        padding-left: 0;
    }

    .header-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    input[type="text"],
    input[type="password"],
    input[type="number"],
    textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    input[type="date"] {
        font-size: 16px;
        max-width: 180px;
    }

    .btn-primary,
    .btn-secondary,
    .add-posting-btn,
    .remove-btn {
        font-size: 16px;
        padding: 10px 14px;
    }

    .autocomplete-items {
        max-height: 150px;
    }
}

/* Very small screens */
@media (max-width: 400px) {
    body {
        padding: 8px;
        padding-bottom: 0;
    }

    h1 {
        font-size: 16px;
    }

    label {
        font-size: 15px;
    }
}
