/* Theme System - Customizable Colors and Styles */

/* Document Template Styles */
.document-template {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    background: white;
    font-family: var(--font-secondary);
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-color);
    position: relative;
    overflow: hidden;
}

/* Template Header */
.template-header {
    background: var(--secondary-color);
    color: white;
    padding: 30px;
    position: relative;
    overflow: hidden;
    min-height: 150px;
    display: flex;
    align-items: center;
}

.template-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 150px 150px 0;
    border-color: transparent var(--primary-color) transparent transparent;
}

.template-header::after {
    content: '';
    position: absolute;
    top: 50px;
    right: 50px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 100px 100px 0;
    border-color: transparent white transparent transparent;
    opacity: 0.1;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    z-index: 2;
    position: relative;
}

.company-info {
    flex: 1;
}

.company-logo {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
}

.company-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.company-logo .default-icon {
    font-size: 24px;
    color: white;
}

.company-name {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.company-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.company-cnpj {
    font-size: 11px;
    opacity: 0.8;
}

.document-title-section {
    text-align: right;
    z-index: 2;
}

.document-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.2;
}

.document-date {
    font-size: 14px;
    background: var(--secondary-color);
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
}

/* Document Body */
.template-body {
    padding: 30px;
}

/* Parties Section */
.parties-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.party-info h3 {
    font-size: 14px;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.party-details {
    background: var(--accent-color);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.party-details p {
    margin-bottom: 5px;
    font-size: 12px;
}

.party-details .name {
    font-weight: bold;
    font-size: 13px;
    color: var(--text-color);
}

.party-details .cnpj {
    color: #666;
    font-size: 11px;
}

.party-details .address {
    color: #666;
    font-size: 11px;
    line-height: 1.3;
    margin-top: 5px;
}

/* Description Section */
.description-section {
    margin-bottom: 30px;
}

.section-title {
    background: var(--primary-color);
    color: white;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 22px 0 22px 10px;
    border-color: transparent transparent transparent var(--primary-color);
}

.description-content {
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.service-list {
    list-style: none;
    padding: 0;
}

.service-list li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    font-size: 12px;
    line-height: 1.4;
}

.service-list li::before {
    content: '•';
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 16px;
}

/* Payment Section */
.payment-section {
    margin-bottom: 40px;
}

.payment-info {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.payment-method,
.payment-date {
    background: var(--accent-color);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.payment-method h4,
.payment-date h4 {
    font-size: 12px;
    color: var(--secondary-color);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.payment-method p,
.payment-date p {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
}

/* Total Section */
.total-section {
    background: var(--secondary-color);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    margin: 0 -30px;
    position: relative;
}

.total-section::before {
    content: '';
    position: absolute;
    top: -10px;
    right: 50px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 10px 10px 10px;
    border-color: transparent transparent var(--secondary-color) transparent;
}

.total-label {
    text-transform: uppercase;
    letter-spacing: 1px;
}

.total-amount {
    font-size: 24px;
    color: var(--primary-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Footer */
.template-footer {
    background: var(--secondary-color);
    color: white;
    padding: 20px 30px;
    margin: 0 -30px -30px -30px;
    position: relative;
    overflow: hidden;
}

.template-footer::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 80px 120px;
    border-color: transparent transparent var(--primary-color) transparent;
}

.footer-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: center;
}

.contact-info p {
    margin-bottom: 5px;
    font-size: 11px;
    opacity: 0.9;
}

.contact-info .address {
    font-weight: 500;
    margin-bottom: 8px;
}

.contact-info .phone,
.contact-info .email {
    color: var(--primary-color);
    font-weight: 500;
}

/* Theme Variations */

/* Blue Theme */
.theme-blue {
    --primary-color: #2196f3;
    --secondary-color: #1976d2;
}

/* Green Theme (Default) */
.theme-green {
    --primary-color: #7cb342;
    --secondary-color: #4a4a4a;
}

/* Purple Theme */
.theme-purple {
    --primary-color: #9c27b0;
    --secondary-color: #7b1fa2;
}

/* Orange Theme */
.theme-orange {
    --primary-color: #ff9800;
    --secondary-color: #f57c00;
}

/* Red Theme */
.theme-red {
    --primary-color: #f44336;
    --secondary-color: #d32f2f;
}

/* Dark Theme */
.theme-dark {
    --primary-color: #ffc107;
    --secondary-color: #212121;
    --text-color: #ffffff;
    --background-color: #303030;
    --accent-color: #424242;
}

.theme-dark .document-template {
    background: #303030;
    color: white;
}

.theme-dark .party-details,
.theme-dark .payment-method,
.theme-dark .payment-date {
    background: #424242;
    color: white;
}

.theme-dark .description-content {
    background: #424242;
    border-color: #555;
    color: white;
}

/* Minimalist Theme */
.theme-minimal {
    --primary-color: #333333;
    --secondary-color: #666666;
}

.theme-minimal .template-header::before,
.theme-minimal .template-header::after,
.theme-minimal .template-footer::before {
    display: none;
}

.theme-minimal .template-header,
.theme-minimal .template-footer {
    background: white;
    color: var(--text-color);
    border-top: 3px solid var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.theme-minimal .section-title::after {
    display: none;
}

.theme-minimal .total-section::before {
    display: none;
}

/* Corporate Theme */
.theme-corporate {
    --primary-color: #b8860b;
    --secondary-color: #000000;
}

.theme-corporate .template-header {
    background: linear-gradient(135deg, var(--secondary-color), #333);
}

.theme-corporate .total-section {
    background: linear-gradient(135deg, var(--secondary-color), #333);
}

.theme-corporate .template-footer {
    background: linear-gradient(135deg, var(--secondary-color), #333);
}

/* Creative Theme */
.theme-creative {
    --primary-color: #e91e63;
    --secondary-color: #673ab7;
}

.theme-creative .template-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.theme-creative .template-header::before {
    border-color: transparent #ff5722 transparent transparent;
}

.theme-creative .total-section {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.theme-creative .template-footer {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.theme-creative .template-footer::before {
    border-color: transparent transparent #ff5722 transparent;
}

/* Print Styles */
@media print {
    .document-template {
        box-shadow: none;
        margin: 0;
        width: 100%;
        min-height: auto;
    }
    
    .template-header,
    .template-footer {
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .section-title {
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .total-section {
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
}

/* Responsive Adjustments for Preview */
@media (max-width: 768px) {
    .document-template {
        width: 100%;
        font-size: 11px;
    }
    
    .template-header {
        padding: 20px;
        min-height: 120px;
    }
    
    .company-name {
        font-size: 20px;
    }
    
    .document-title {
        font-size: 14px;
    }
    
    .template-body {
        padding: 20px;
    }
    
    .parties-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .payment-info {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

