:root {
    --primary-color: #1a5276;
    --secondary-color: #2874a6;
    --accent-color: #3498db;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --success-color: #28a745;
}

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

body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f0f2f5;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Header Section */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
}

.title-section h1 {
    font-size: 24px;
    color: var(--primary-color);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo-section img {
    max-height: 80px;
    max-width: 180px;
}

/* Customer Info Section */
.customer-info {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.left-info, .right-info {
    flex: 1;
}

.info-row {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.info-row label {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--primary-color);
    font-size: 14px;
}

.info-row input, .info-row textarea {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.info-row input:focus, .info-row textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

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

/* Items Table */
.items-section {
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

th, td {
    border: 1px solid var(--border-color);
    padding: 10px;
    text-align: left;
}

th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

.item-input {
    width: 100%;
    padding: 6px;
    border: 1px solid transparent;
    background-color: transparent;
}

.item-input:focus {
    border: 1px solid var(--accent-color);
    outline: none;
    background-color: white;
}

.item-select {
    width: 100%;
    padding: 6px;
    border: 1px solid var(--border-color);
}

/* Summary Section */
.summary-section {
    width: 40%;
    margin-left: auto;
    margin-bottom: 30px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-row:last-child {
    font-weight: bold;
    font-size: 18px;
    border-bottom: 2px solid var(--primary-color);
}

/* Terms Section */
.terms-section {
    margin-bottom: 30px;
}

.terms-section h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

#terms-list {
    margin-bottom: 15px;
}

#terms-list p {
    margin-bottom: 5px;
    font-size: 14px;
    line-height: 1.5;
}

.terms-section p {
    font-size: 14px;
    margin-bottom: 10px;
}

/* Signature Section */
.signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
}

.signature-block {
    width: 45%;
    text-align: center;
}

.signature-block h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.signature-name, .signature-email {
    margin-bottom: 10px;
    min-height: 24px;
    border-bottom: 1px dotted var(--border-color);
    padding: 5px;
}

.signature-image {
    height: 80px;
    border-bottom: 1px solid var(--border-color);
    margin-top: 20px;
}

/* Button Styles */
.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

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

.btn i {
    font-size: 16px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* Delete Button */
.delete-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.delete-btn:hover {
    background-color: #c82333;
}

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

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 60%;
    max-width: 600px;
    animation: modalOpen 0.3s;
}

@keyframes modalOpen {
    from {opacity: 0; transform: scale(0.8);}
    to {opacity: 1; transform: scale(1);}
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--dark-color);
}

/* Mobile Responsive Styles */
@media screen and (max-width: 1024px) {
    .container {
        padding: 20px;
    }
    
    .header {
        flex-direction: column;
    }
    
    .logo-section img {
        max-height: 60px;
        margin-top: 10px;
    }
    
    .action-buttons {
        flex-wrap: wrap;
    }
    
    .summary-section {
        width: 100%;
    }
}

@media screen and (max-width: 768px) {
    .customer-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .items-section table {
        display: block;
        overflow-x: auto;
    }
    
    .signatures {
        flex-direction: column;
        gap: 30px;
    }
    
    .signature-block {
        width: 100%;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    .title-section h1 {
        font-size: 20px;
    }
    
    .terms-section ul {
        padding-left: 15px;
    }
    
    .terms-section li, .terms-section p {
        font-size: 12px;
    }
    
    .info-row label {
        font-size: 12px;
    }
    
    .info-row input, .info-row textarea {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
    }
}

/* Print Specific Styles */
@media print {
    body {
        background-color: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        max-width: 100%;
        padding: 15px;
        border-radius: 0;
    }
    
    .action-buttons {
        display: none;
    }
    
    input, textarea, [contenteditable="true"] {
        border-color: transparent !important;
    }
    
    .item-input, .item-select {
        border: none !important;
        background-color: transparent !important;
    }

    .modal {
        display: none !important;
    }
    
    /* Improve table display for printing */
    th, td {
        padding: 5px 8px;
    }
    
    /* Hide delete buttons when printing */
    .delete-btn {
        display: none;
    }
}
