body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding: 20px;
    color: #333;
}

.page {
    background-color: white;
    width: 210mm; /* A4 width */
    min-height: 297mm; /* A4 height */
    margin: 0 auto;
    padding: 20mm;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    box-sizing: border-box;
    position: relative;
}

.controls {
    text-align: center;
    margin-bottom: 20px;
}

button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

button:hover {
    background-color: #45a049;
}

/* Header */
header {
    margin-bottom: 15px;
}

.banner-container {
    width: 100%;
    text-align: center;
    margin-bottom: 15px;
}

.banner-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

.date-line {
    font-size: 0.9em;
    text-align: right;
    margin-top: 10px;
}

.text-center {
    text-align: center;
}

/* Sections */
section {
    margin-bottom: 10px;
}

h3 {
    text-transform: uppercase;
    border-bottom: 1px solid #000;
    padding-bottom: 3px;
    margin-bottom: 6px;
    margin-top: 8px;
    font-size: 1.1em;
}

h4 {
    margin-bottom: 5px;
    text-decoration: underline;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}

table, th, td {
    border: 1px solid black;
}

td {
    padding: 5px;
}

.measures-table td:first-child {
    width: 40%;
}

.quote-table td {
    text-align: right;
}

.quote-table td:first-child {
    text-align: left;
}

/* Footer */
.footer-contact {
    margin-top: 15px;
    border-top: 1px solid #ddd;
    padding-top: 8px;
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #666;
}

/* Utilities */
.small-note {
    font-size: 0.8em;
    font-style: italic;
}

.page-break {
    page-break-before: always;
    height: 50px; /* Visual spacer for web view */
}

/* Certificates Section */
.certificates-section {
    text-align: center;
    margin-top: 30px;
}

.certificates-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: nowrap;
}

.certificate-card {
    background: white;
    border: 2px solid #2e74b5;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex: 0 1 400px;
    max-width: 400px;
}

.certificate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.certificate-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 5px;
}

/* Editable highlights for web view */
[contenteditable="true"]:hover {
    background-color: #f9f9f9;
    outline: 1px dashed #ccc;
}

/* Print / PDF specific styles */
@media print {
    body {
        background-color: white;
        padding: 0;
    }
    .page {
        box-shadow: none;
        margin: 0;
        width: 100%;
    }
    .controls {
        display: none;
    }
    [contenteditable="true"]:hover {
        background-color: transparent;
        outline: none;
    }
}
