@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');

body {
    font-family: 'Inter', sans-serif;
    color: #111;
    background: white;
    margin: 0;
    padding: 10mm;
}

.square-ratio {
    position: relative;
    width: 100%;
    padding-top: 100%;
    height: 0;
    overflow: hidden;
}

.square-ratio img {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.hexagon-clip {
    clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
}

.pedigree-table-container {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
}

.pedigree-grid-container {
    padding: 12px;
    background: linear-gradient(180deg, #fff7ed, #fffbeb);
    border: 2px solid #fca311;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(252, 163, 17, 0.15);
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.pedigree-table {
    border-collapse: collapse;
    font-size: 0.85rem;
    width: auto;
    word-spacing: normal;
}

.pedigree-table.no-header thead {
    display: none;
}

.pedigree-table td {
    padding: 3px 2px;
    text-align: center;
    border: none;
    white-space: nowrap;
    background-color: transparent;
    overflow: visible;
    word-spacing: normal;
}

.pedigree-table td:nth-child(1) {
    min-width: 50px !important;
    text-align: left;
    padding-right: 0px !important;
}

.pedigree-table td:nth-child(2) {
    min-width: 1px !important;
    padding: 0px !important;
}

.pedigree-table td:nth-child(3) {
    min-width: 3px;
    padding: 3px 0;
}

.pedigree-table td:nth-child(4) {
    min-width: 20px;
}

.pedigree-table td:nth-child(5) {
    min-width: 5px;
    padding: 3px 1px;
}

.pedigree-table td:nth-child(6) {
    min-width: 25px;
    text-align: left;
    padding-right: 1px;
}

.pedigree-table td:nth-child(7) {
    min-width: 15px;
}

.pedigree-table td:nth-child(8) {
    min-width: 25px;
    text-align: left;
    padding-right: 1px;
}

.pedigree-table td:nth-child(9) {
    min-width: 15px !important;
    padding-right: 0px !important;
}

.pedigree-table td:nth-child(10) {
    min-width: 1px !important;
    padding: 0px !important;
}

.text-green-600 {
    color: #059669;
}

.text-blue-600 {
    color: #2563eb;
}

.underline-element {
    text-decoration: underline;
}

.underline-green {
    text-decoration-color: #059669;
}

.pedigree-id-tag {
    background-color: transparent;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    display: inline-block;
}

.origin-code {
    font-weight: 600;
    margin-right: 4px;
}

.font-bold {
    font-weight: 700;
}

.text-secondary {
    color: #14213d;
}

.text-center {
    text-align: center;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.p-4 {
    padding: 1rem;
}

.shadow {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rounded-lg {
    border-radius: 0.5rem;
}

.bg-white {
    background: #fff;
}

.gap-6 {
    gap: 1.5rem;
    display: flex;
}

.items-start {
    align-items: flex-start;
}

.w-quarter {
    width: 25%;
}

.flex-1 {
    flex: 1;
}

.border-2 {
    border-width: 2px;
}

.border-primary {
    border-color: #fca311;
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 1024px) {
    .pedigree-table {
        font-size: 0.85rem;
        min-width: 850px;
    }
    .pedigree-table th,
    .pedigree-table td {
        padding: 8px 12px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 5mm;
    }
    .pedigree-table {
        font-size: 0.8rem;
        min-width: 800px;
    }
    .pedigree-table th,
    .pedigree-table td {
        padding: 7px 10px;
    }
    .pedigree-table th {
        font-size: 0.75rem;
    }
    .w-quarter {
        width: 100%;
        margin-bottom: 1rem;
    }
    .gap-6 {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .pedigree-table {
        font-size: 0.75rem;
        min-width: 700px;
    }
    .pedigree-table th,
    .pedigree-table td {
        padding: 6px 8px;
    }
    .pedigree-table th {
        font-size: 0.7rem;
    }
    .text-sm {
        font-size: 0.75rem;
    }
}

@media print {
    body {
        background: white;
        margin: 0;
        padding: 0;
    }
    
    @page {
        size: A4 portrait;
        margin: 0;
    }
    
    .no-print {
        display: none !important;
    }
    
    /* Folha A4 em vertical */
    .folha-a4-print {
        width: 210mm;
        height: 297mm;
        background-color: white;
        position: relative;
        box-sizing: border-box;
        padding: 5mm; /* Margem de 5mm da borda do papel */
        page-break-after: always;
    }
    
    /* Moldura limite */
    .moldura-limite {
        width: 100%;
        height: 100%;
        position: relative;
        overflow: hidden; /* Corta o que sobrar para fora da linha */
        border: 1.2mm solid #b8860b;
        box-sizing: border-box;
    }
    
    /* Linha interna da moldura */
    .linha-interna {
        position: absolute;
        top: 1.5mm;
        left: 1.5mm;
        right: 1.5mm;
        bottom: 1.5mm;
        border: 0.4mm solid #b8860b;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 10mm;
    }
    
    /* Hexágono Decorativo */
    .hex-canto {
        width: 22mm;
        height: 22mm;
        background-color: #b8860b;
        position: absolute;
        clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
        z-index: 5;
    }
    
    /* Ajuste para mostrar mais a "ponta" (o coqueirinho) para dentro */
    .topo-esq { top: -8mm; left: -8mm; }
    .topo-dir { top: -8mm; right: -8mm; }
    .baixo-esq { bottom: -8mm; left: -8mm; }
    .baixo-dir { bottom: -8mm; right: -8mm; }
    
    /* Forçar cores exatas na impressão */
    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
