/* Email Template Customizer Frontend Styles */

/* Email template base styles */
.etc-email-template {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

.etc-email-container {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.etc-email-header {
    background-color: #f8f9fa;
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.etc-email-content {
    padding: 30px 20px;
}

.etc-email-footer {
    background-color: #f8f9fa;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e9ecef;
    font-size: 12px;
    color: #6c757d;
}

/* Typography */
.etc-email-template h1,
.etc-email-template h2,
.etc-email-template h3,
.etc-email-template h4,
.etc-email-template h5,
.etc-email-template h6 {
    margin: 0 0 15px 0;
    font-weight: bold;
    line-height: 1.2;
}

.etc-email-template h1 {
    font-size: 28px;
}

.etc-email-template h2 {
    font-size: 24px;
}

.etc-email-template h3 {
    font-size: 20px;
}

.etc-email-template h4 {
    font-size: 18px;
}

.etc-email-template h5 {
    font-size: 16px;
}

.etc-email-template h6 {
    font-size: 14px;
}

.etc-email-template p {
    margin: 0 0 15px 0;
    line-height: 1.6;
}

/* Buttons */
.etc-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #007cba;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.etc-button:hover {
    background-color: #005a87;
    color: #ffffff;
    text-decoration: none;
}

.etc-button-secondary {
    background-color: #6c757d;
}

.etc-button-secondary:hover {
    background-color: #545b62;
}

.etc-button-success {
    background-color: #28a745;
}

.etc-button-success:hover {
    background-color: #218838;
}

/* Images */
.etc-email-template img {
    max-width: 100%;
    height: auto;
    display: block;
}

.etc-image-center {
    margin: 0 auto;
}

.etc-image-left {
    margin-right: auto;
}

.etc-image-right {
    margin-left: auto;
}

/* Dividers */
.etc-divider {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 20px 0;
}

.etc-divider-thick {
    border-top-width: 2px;
}

.etc-divider-dashed {
    border-top-style: dashed;
}

/* Spacers */
.etc-spacer {
    height: 20px;
    line-height: 20px;
    font-size: 1px;
}

/* Social media icons */
.etc-social-links {
    text-align: center;
    margin: 20px 0;
}

.etc-social-link {
    display: inline-block;
    margin: 0 8px;
    text-decoration: none;
}

.etc-social-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: opacity 0.3s ease;
}

.etc-social-icon:hover {
    opacity: 0.8;
}

/* Tables */
.etc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.etc-table th,
.etc-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #e9ecef;
}

.etc-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.etc-table-striped tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Order details */
.etc-order-details {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.etc-order-details h3 {
    margin-top: 0;
    color: #495057;
}

.etc-order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.etc-order-item:last-child {
    border-bottom: none;
}

.etc-order-item-name {
    font-weight: bold;
}

.etc-order-item-details {
    font-size: 14px;
    color: #6c757d;
}

.etc-order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 2px solid #dee2e6;
    font-weight: bold;
    font-size: 18px;
}

/* Address blocks */
.etc-address-block {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
}

.etc-address-block h4 {
    margin-top: 0;
    color: #495057;
}

.etc-address-line {
    margin: 5px 0;
}

/* Two column layout for addresses */
.etc-address-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

/* Responsive design */
@media only screen and (max-width: 600px) {
    .etc-email-template {
        width: 100% !important;
        max-width: none !important;
    }

    .etc-email-content {
        padding: 20px 15px !important;
    }

    .etc-email-header,
    .etc-email-footer {
        padding: 15px !important;
    }

    .etc-address-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .etc-table {
        font-size: 14px !important;
    }

    .etc-table th,
    .etc-table td {
        padding: 8px !important;
    }

    .etc-button {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin: 10px 0 !important;
    }

    .etc-social-links {
        margin: 15px 0 !important;
    }

    .etc-social-link {
        margin: 0 5px !important;
    }

    .etc-order-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left !important;
    }
}

/* Dark mode email client support */
@media (prefers-color-scheme: dark) {
    .etc-email-template {
        background-color: #1a1a1a !important;
        color: #ffffff !important;
    }

    .etc-email-container {
        background-color: #2d2d2d !important;
    }

    .etc-email-header,
    .etc-email-footer {
        background-color: #3d3d3d !important;
        color: #ffffff !important;
    }

    .etc-order-details,
    .etc-address-block {
        background-color: #3d3d3d !important;
        border-color: #4d4d4d !important;
    }

    .etc-table th {
        background-color: #3d3d3d !important;
        color: #ffffff !important;
    }

    .etc-table-striped tbody tr:nth-child(even) {
        background-color: #3d3d3d !important;
    }

    .etc-divider {
        border-top-color: #4d4d4d !important;
    }
}

/* Print styles */
@media print {
    .etc-email-template {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    .etc-button {
        border: 1px solid #007cba !important;
    }

    .etc-social-links {
        display: none !important;
    }
}