/* Base Styles */
:root {
    --primary-color: #4a6da7;
    --primary-dark: #3a5a8c;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-color: #e9ecef;
    --text-color: #212529;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: #f5f5f7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.2;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Splash Screen */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.splash-content {
    text-align: center;
    color: white;
}

.splash-content img {
    width: 100px;
    /*height: 100px;*/
    margin-bottom: 20px;
}

.splash-content h1 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Screen Styles */
.screen {
    display: none;
    min-height: 100vh;
    padding: 0;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 10px 0;
}

/* Card Styles */
.card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
}

.checkbox {
    display: flex;
    align-items: center;
}

.checkbox input {
    margin-right: 10px;
}

.checkbox label {
    margin-bottom: 0;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    width: 100%;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.btn-icon.small {
    padding: 2px;
}

.btn-icon svg {
    fill: var(--secondary-color);
    transition: var(--transition);
}

.btn-icon:hover svg {
    fill: var(--primary-color);
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--primary-color);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 1.5rem;
    margin: 0;
}

header .btn-icon svg {
    fill: white;
}

/* Main Content Styles */
main {
    padding: 20px;
    padding-top: 0;
}

/* Pull to Refresh */
#pull-to-refresh {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    margin-bottom: 20px;
    height: 80px;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

#pull-to-refresh.visible {
    transform: translateY(0);
}

#pull-to-refresh span {
    margin-top: 10px;
    font-size: 14px;
    color: var(--secondary-color);
}

/* Summary Card */
.summary-card {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.summary-item {
    text-align: center;
    padding: 10px;
}

.summary-item h3 {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.summary-item p {
    font-size: 1.5rem;
    font-weight: 600;
}

.summary-item.highlight {
    grid-column: span 2;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 15px;
}

.summary-item.highlight p {
    color: var(--primary-color);
}

/* List Styles */
.list {
    margin-top: 15px;
}

.list-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.list-item-title {
    font-weight: 600;
}

.list-item-subtitle {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.list-item-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-item-description {
    color: var(--text-color);
}

.list-item-value {
    font-weight: 600;
    color: var(--primary-color);
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--secondary-color);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
}

.modal-body {
    padding: 20px;
}

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

    .summary-item.highlight {
        grid-column: span 1;
    }
}

/* Active Screen */
.screen.active {
    display: block;
}
