/* Basic Reset & Body Styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    padding-bottom: 80px; /* Space for the save button */
}

header img {
    display: block;
    width: 100%;
    max-width: 800px; /* Adjust max width as needed */
    margin: 0 auto;
    height: auto;
}

main {
    max-width: 900px; /* Max width for larger screens */
    margin: 20px auto;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

h2 {
    color: #003366; /* Srixon-like blue */
    margin-top: 25px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid #e0e0e0;
}

/* Form Sections & Groups */
section {
    margin-bottom: 30px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fdfdfd;
}

.items-container .item {
    border: 1px dashed #ccc;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    position: relative; /* For positioning the remove button */
    background-color: #fff;
}

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

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

input[type="text"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    background-color: #fff; /* Ensure background for iOS */
    -webkit-appearance: none; /* Remove default iOS styling */
    -moz-appearance: none;
    appearance: none;
}

select {
    /* Custom dropdown arrow */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007AFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 14px auto;
    padding-right: 30px; /* Make space for arrow */
}

/* Ensure default select option is visible */
select:invalid {
  color: #6c757d; /* Light grey color for the default "-- Select --" */
}


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

/* Buttons */
button {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
    margin-top: 10px;
}

.add-item-btn {
    background-color: #4CAF50; /* Green */
    color: white;
    display: block;
    margin-left: auto; /* Align right if container allows */
    margin-right: 0;
}

.add-item-btn:hover {
    background-color: #45a049;
}

.remove-item-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #f44336; /* Red */
    color: white;
    padding: 4px 8px;
    font-size: 0.8rem;
    line-height: 1;
    border-radius: 50%;
    font-weight: bold;
    margin-top: 0; /* Override default margin */
    border: 1px solid white; /* Optional: slight border */
}

.remove-item-btn:hover {
    background-color: #d32f2f;
}


#save-pdf-btn {
    display: block;
    width: calc(100% - 30px); /* Adjust width based on main padding */
    max-width: 870px; /* Corresponds to main max-width minus padding */
    margin: 30px auto 20px auto;
    background-color: #007AFF; /* Blue */
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
}

#save-pdf-btn:hover {
    background-color: #0056b3;
}

/* Responsive Adjustments remain the same */
@media (min-width: 768px) {
    /* Optional: Adjust item layout on wider screens */
}

@media (max-width: 767px) {
    body {
        padding-bottom: 70px;
    }
    main {
        margin: 10px;
        padding: 10px;
    }
     #save-pdf-btn {
        width: calc(100% - 20px);
    }
}

/* Styles for .pdf-generating and @media print can be removed as they are no longer used for PDF generation */