/*
 * File: frontend.css
 * Định dạng giao diện và xuất PDF cho bản đồ sao chiêm tinh
 * Chỉnh sửa để:
 * - Bỏ trang trắng đầu tiên
 * - Giữ tiêu đề "Bản Đồ Sao" và bản đồ sao trên cùng trang
 * - Đẩy tiêu đề "Sự Nghiệp", "Tình Yêu", "Mục Đích Sống" xuống để tránh cắt chữ
 * - Tăng độ đậm font chữ cho phần luận giải chiêm tinh
 */
body {
    font-family: 'Roboto', Arial, sans-serif;
    background: linear-gradient(135deg, #f0f4f8, #d9e2ec);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.xembandosa-container, .xembandosa-form-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.xembandosa-form-container h2 {
    text-align: center;
    color: #ffffff;
    background: #6F0092;
    font-size: 22px;
    margin: 0;
    border-radius: 10px 10px 0 0;
    height: 60px;
    line-height: 60px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.xembandosa-form-container .xembandosa-form-title {
    text-align: center;
    color: #ffffff;
    background: #6F0092;
    font-size: 22px;
    margin: 0;
    border-radius: 10px 10px 0 0;
    height: 60px;
    line-height: 60px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .xembandosa-form-container .xembandosa-form-title {
        font-size: 20px;
        height: 60px;
        line-height: 60px;
        padding: 0 15px;
    }
}

.xembandosa-form-container form {
    padding-top: 20px;
}

.xembandosa-container h2 {
    text-align: center;
    color: #34495e;
    font-size: 22px;
    margin-bottom: 20px;
	margin-top: 20px;
    page-break-before: always;
    page-break-inside: avoid;
}

.xembandosa-container h2:first-child {
    page-break-before: avoid;
}

.xembandosa-container h3 {
    text-align: center;
    color: #34495e;
    font-size: 20px;
    margin: 30px 0 20px;
    page-break-inside: avoid;
}

.xembandosa-container .chart-container {
    text-align: center;
    margin: 10px 0;
    page-break-inside: avoid;
}
.xembandosa-container .interpretation h2:first-child {
    margin-top: 10px;
}
.xembandosa-container .interpretation h2:not(:first-child) {
    margin-top: 40px;
}

.form-control {
    border-radius: 5px;
    padding: 12px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #6F0092;
    box-shadow: 0 0 5px rgba(111,0,146,0.3);
}

form#xembandosa-form .btn-primary {
    background: #6F0092;
    border: none;
    color: #fff;
    font-weight: bold;
    padding: 15px 40px;
    font-size: 20px;
    margin-top: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: uppercase;
}

form#xembandosa-form .btn-primary:hover {
    background: #9609aa;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.btn-pdf {
    background: #6F0092;
    border: none;
    color: #fff;
    font-weight: bold;
    padding: 15px 40px;
    font-size: 20px;
    margin-top: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: uppercase;
}

.btn-pdf:hover {
    background: #9609aa;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.table-responsive {
    margin-bottom: 30px;
    overflow-x: auto;
}

.table {
    background: #f8f9fa;
    overflow: hidden;
    width: 100%;
    margin: 0 auto;
    border-collapse: collapse;
}

.table th {
    padding: 15px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
}

.table td {
    padding: 15px;
    text-align: center;
    font-size: 16px;
	font-weight: 400;
}

.table thead {
    background: #34495e;
    color: #ffffff;
}

#natalChartCanvas {
    max-width: 850px;
    height: 850px;
    margin: 0 auto;
    border: 1px solid #34495e;
    border-radius: 10px;
}

.interpretation {
    margin-top: 30px auto;
    padding: 25px 0 25px 0;
    line-height: 1.8;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 450;
    text-align: justify;
}

.interpretation img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    page-break-inside: avoid;
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-content {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .xembandosa-container, .xembandosa-form-container {
        padding: 20px;
        margin: 5px;
    }
    .xembandosa-form-container h2 {
        font-size: 20px;
        height: 60px;
        line-height: 60px;
        padding: 0 15px;
    }
    #natalChartCanvas {
        width: 100%;
        height: auto;
        margin: 0 auto;
    }
}