/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

/* Container for centering content */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Header */
h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

/* Form styling */
#receipt-form {
    display: grid;
    gap: 20px;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #f8f9ff, #e8f4f8);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid rgba(52, 152, 219, 0.1);
}

.buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.hidden {
    display: none;
}

.form-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="number"],
input[type="date"] {
    padding: 12px 15px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

input[type="number"] {
    -moz-appearance: textfield; /* Hide spinner in Firefox */
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

button[type="submit"] {
    padding: 15px 30px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

button[type="submit"]:hover {
    background: linear-gradient(135deg, #2980b9, #3498db);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.4);
}

/* Receipts preview */
#receipts-preview {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.receipt {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    max-width: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.note {
    font-style: italic;
    font-size: 0.9em;
    color: #666;
    margin: 8px 0;
    text-align: center;
}

.header {
    margin-bottom: 10px;
}

.header h2 {
    text-align: center;
    color: #2c3e50;
    margin: 0;
    font-size: 18px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.month-year {
    text-align: center;
    margin: 5px 0;
    font-weight: bold;
    font-size: 14px;
    color: #2c3e50;
}

.receipt-details {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    font-size: 12px;
}

.receipt-details p {
    margin: 0;
}

.body-paragraph {
    margin: 15px 0;
    text-align: justify;
    line-height: 1.4;
}

.landlord-info {
    margin: 20px 0;
    text-align: left;
}

.landlord-info p {
    margin: 5px 0;
    font-weight: bold;
}

.signature {
    margin: 20px 0;
    text-align: left;
}

.signature hr {
    margin-bottom: 5px;
}

.signature p {
    margin: 0;
}

.receipt p {
    margin-bottom: 8px;
}

.receipt hr {
    margin: 5px 0;
    border: none;
    border-top: 1px solid #ddd;
}

.footer {
    text-align: center;
    font-style: italic;
    color: #7f8c8d;
    margin-top: 15px;
    font-size: 0.9em;
}

/* Print button */
#print-button {
    padding: 15px 30px;
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

#print-button:hover {
    background: linear-gradient(135deg, #229954, #27ae60);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(39, 174, 96, 0.4);
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
}

/* Print styles - 3 receipts per A4 page */
@media print {
    body {
        background: white;
        box-shadow: none;
    }
    
    .container {
        box-shadow: none;
        max-width: none;
        padding: 0;
        margin: 0;
    }
    
    h1, #receipt-form, #print-button {
        display: none;
    }
    
    #receipts-preview {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        justify-content: space-around;
    }
    
    .receipt {
        width: 90%;
        max-width: none;
        margin: 0 5% 10px;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
        padding: 18px;
        font-size: 13px;
    }
    
    .receipt:nth-child(3n+3) {
        page-break-after: always;
    }
    
    .header h2 {
        font-size: 16px;
        border-bottom: 1px solid #000;
        padding-bottom: 3px;
    }

    .month-year {
        font-size: 13px;
    }

    .receipt-details {
        font-size: 11px;
    }

    .note {
        font-size: 8px;
        margin: 6px 0;
    }

    .body-paragraph {
        font-size: 12px;
        margin: 10px 0;
    }

    .landlord-info p {
        margin: 3px 0;
        font-size: 11px;
    }

    .signature {
        margin: 15px 0;
    }

    .footer {
        font-size: 10px;
        margin-top: 10px;
    }
    
    .receipt p {
        margin-bottom: 4px;
        font-size: 11px;
    }

    .body-paragraph {
        font-size: 12px;
        margin: 10px 0;
    }

    .landlord-info p {
        margin: 3px 0;
        font-size: 11px;
    }

    .signature {
        margin: 15px 0;
    }

    .footer {
        font-size: 10px;
        margin-top: 10px;
    }
    
    @page {
        size: A4;
        margin: 1cm;
    }
}
/* Error message styles */
.error-message {
   color: #e74c3c;
   font-size: 12px;
   margin-top: 5px;
   display: block;
   transition: opacity 0.3s ease;
}

.error-message.hidden {
   display: none;
}

input:invalid + .error-message {
   display: block;
}