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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 800px; /* Adjusted for better fit */
    margin: 0 auto;
    background-color: #fff;
    padding: 20px; /* Reduced padding */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #0056b3;
}

/* Form Styles */
.header-section {
    margin-bottom: 15px; /* Reduced margin */
    padding: 20px;
    background-color: #f0f8ff;
    border-radius: 5px;
    border-left: 4px solid #0056b3;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.header-section .form-group {
    flex: 1;
    min-width: 300px;
    margin-right: 15px;
}

.header-section .form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sections-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .sections-container {
        grid-template-columns: 1fr;
    }
    
    .header-section {
        flex-direction: column;
    }
    
    .header-section .form-group {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }
}

.form-section {
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border-left: 4px solid #0056b3;
    height: 100%;
}

.form-section h2 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: #0056b3;
}

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

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

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: "Arial", sans-serif;
}


select {
    cursor: pointer;
}

textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

button {
    padding: 12px 24px;
    background-color: #0056b3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #003d82;
}

button[type="reset"] {
    background-color: #6c757d;
}

button[type="reset"]:hover {
    background-color: #5a6268;
}

/* PDF Preview Styles */
.hidden {
    display: none;
}

#pdfPreview {
    max-width: 900px;
    margin: 0 auto;
    background-color: #fff;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#reportCard {
    background-image: url('images/background.png');
    padding: 10px 30px 30px 0px; /* Reduced top padding */
    max-width: 100%;
    margin: 0 auto;
    page-break-inside: avoid;
    border-left: 100px solid #0056b3; /* Blue vertical bar on left */
    box-sizing: border-box;
}

.report-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px; /* Reduced margin */
    border-bottom: 2px solid #0056b3;
    padding-bottom: 10px; /* Reduced padding */
}

.logo-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo {
    font-weight: bold;
    color: #0056b3;
}

.patterson-logo {
    font-size: 1.5rem;
    margin-bottom: 5px;
    width: 200px;
}

.doctors-logo {
    font-size: 1.2rem;
        width: 200px;

}

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

.report-title h1 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    text-align: right;
}

.report-title h2 {
    font-size: 1.8rem;
    color: #0056b3;
    margin-bottom: 5px;
}

.report-sections {
    display: flex;
    flex-direction: column;
    gap: 15px;
    page-break-inside: avoid;
}

.report-section {
    display: flex;
    gap: 15px;
    padding: 10px;
    page-break-inside: avoid;
    page-break-after: auto;
}

.section-icon {
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: white;
    padding: 5px;;
    border-radius: 50%;
}

.section-content {
    flex: 1;
}

.section-content h3 {
    margin-bottom: 5px;
    color: #0056b3;
}

.section-content h4 {
    margin-bottom: 10px;
    color: #6c757d;
}

.report-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
}

.report-summary {
    background-color: #e0e0e0; /* Gray background */
    padding: 15px 20px;
    margin: 20px 0 0 0;
    border-radius: 5px;
    page-break-inside: avoid;
    width: 100%;
    bottom: 0;
    left: 0;
    z-index: 99999999;
    clear: both;
    display: flex;
    


.preview-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* Grade Colors */
.grade-a { color: #28a745; }
.grade-b { color: #17a2b8; }
.grade-c { color: #ffc107; }
.grade-d { color: #fd7e14; }
.grade-f { color: #dc3545; }
/* Debug: Add red border to PDF preview container to check visibility */
#pdfPreview {
  border: 2px solid red !important;
}