/* ===== Global ===== */
body {
    font-family: Verdana, Arial, sans-serif;
    font-size: 11px;
    line-height: 1.35;
    margin: 0;
    padding: 0;
    background: #f8f5fb; /* light lilac background */
    color: #333;
}

/* ===== Header & Nav (if used) ===== */
header {
    background: #9b59b6; /* deep lilac */
    color: white;
    padding: 8px 12px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

header h1 {
    margin: 0 0 4px 0;
    font-size: 16px;
}

nav {
    margin-top: 2px;
}

nav a {
    color: white;
    text-decoration: none;
    margin: 0 8px;
    font-weight: bold;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 11px;
    transition: background 0.2s ease-in-out;
}

nav a:hover {
    background: #8e44ad; /* darker lilac */
}

/* ===== Main Content ===== */
main {
    max-width: 900px;
    margin: 15px auto;
    padding: 12px 15px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ===== Headings ===== */
h1 {
    font-size: 16px;
    margin: 0 0 8px 0;
}

h2 {
    font-size: 13px;
    color: #6a1b9a; /* purple accent */
    border-bottom: 1px solid #e1bee7;
    padding-bottom: 3px;
    margin: 8px 0 8px 0;
}

h3 {
    font-size: 12px;
    margin: 6px 0;
}

h4 {
    font-size: 11px;
    margin: 4px 0;
}

/* ===== Tables ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    background: #fafafa;
    font-size: 11px;
}

table th {
    background: #e1bee7; /* soft lilac */
    color: #4a148c;
    padding: 4px 6px;
    text-align: left;
}

table td {
    border: 1px solid #ddd;
    padding: 4px 6px;
}

/* ===== Forms ===== */
form label {
    display: block;
    margin: 6px 0 3px;
    font-weight: bold;
    font-size: 11px;
}

form input,
form select,
form textarea,
form button {
    width: 100%;
    padding: 4px 5px;
    margin-bottom: 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 11px;
    font-family: Verdana, Arial, sans-serif;
}

form textarea {
    resize: vertical;
}

form input:focus,
form select:focus,
form textarea:focus {
    border-color: #9b59b6;
    outline: none;
    box-shadow: 0 0 3px rgba(155,89,182,0.5);
}

form button {
    background: #9b59b6;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    width: auto;
    padding: 5px 10px;
}

form button:hover {
    background: #8e44ad;
}

/* ===== Pedigree Tree (Table Layout) ===== */
.pedigree-table {
    border-collapse: collapse;
    margin: 12px auto;
    width: 100%;
    table-layout: fixed;
    text-align: center;
    font-size: 11px;
}

.pedigree-table td {
    padding: 3px;
    vertical-align: middle;
}

.pedigree-box {
    border: 1px solid #9b59b6; /* lilac border */
    background: #f3e5f5;
    padding: 4px;
    text-align: center;
    min-width: 110px;
    border-radius: 4px;
    font-size: 11px;
    transition: transform 0.2s, background 0.2s;
}

.pedigree-box:hover {
    background: #e1bee7;
    transform: scale(1.02);
}

.pedigree-box a {
    text-decoration: none;
    color: #4b0082; /* dark lilac text */
    font-weight: bold;
}

.empty {
    border: 1px dashed #ccc;
    padding: 4px;
    min-width: 110px;
    text-align: center;
    color: #aaa;
    border-radius: 4px;
    background: #fafafa;
}

/* Pedigree Generations Shading */
.pedigree-table .gen0 { background: #f3e5f5; }  /* Dog */
.pedigree-table .gen1 { background: #ede7f6; }  /* Parents */
.pedigree-table .gen2 { background: #e8eaf6; }  /* Grandparents */
.pedigree-table .gen3 { background: #e3f2fd; }  /* Great-grandparents */
.pedigree-table .gen4 { background: #e0f7fa; }  /* 4th gen */

.pedigree-photo {
    display: block;
    margin: 3px auto 0;
    max-width: 80px;
    max-height: 80px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #bbb;
}

.pedigree-photo.placeholder {
    background: #f0f0f0;
    color: #888;
    font-size: 10px;
    line-height: 80px;
    text-align: center;
}

/* ===== Dog Profile Layout ===== */
.dog-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* two equal columns */
    gap: 18px;
    margin-bottom: 15px;
}

.dog-info table,
.dog-health table {
    width: 100%;
    border-collapse: collapse;
    background: #fafafa;
    margin-bottom: 8px;
}

.dog-info th,
.dog-health th {
    background: #e1bee7;
    color: #4a148c;
    text-align: left;
    padding: 4px 6px;
    width: 40%;
    font-size: 11px;
}

.dog-info td,
.dog-health td {
    border: 1px solid #ddd;
    padding: 4px 6px;
    vertical-align: top;
}

.dog-health h2,
.dog-health h3 {
    color: #6a1b9a;
    margin-top: 4px;
    margin-bottom: 4px;
    border-bottom: 1px solid #e1bee7;
    padding-bottom: 3px;
    font-size: 12px;
}

/* Style dog photo inside profile */
.dog-info img {
    margin-top: 8px;
    max-width: 100%;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ===== FIXED SIDEBAR MENU ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 210px;
    height: 100%;
    background: #9b59b6; /* lilac */
    padding: 12px;
    color: white;
    box-shadow: 2px 0 6px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 11px;
}

.sidebar h2 {
    margin-top: 0;
    font-size: 14px;
    text-align: center;
    color: white;
    margin-bottom: 10px;
}

.sidebar a {
    display: block;
    padding: 6px 8px;
    color: white;
    text-decoration: none;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    font-weight: bold;
    font-size: 11px;
    transition: background 0.2s;
}

.sidebar a:hover {
    background: rgba(255,255,255,0.3);
}

/* Highlight logout red-ish */
.sidebar a.logout {
    background: rgba(255,80,80,0.4);
}
.sidebar a.logout:hover {
    background: rgba(255,50,50,0.6);
}

/* ===== ADJUST MAIN CONTENT FOR SIDEBAR ===== */
.page-content {
    margin-left: 230px;
    padding: 15px;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 8px 0;
    margin-top: 20px;
    color: #555;
    font-size: 10px;
    opacity: 0.8;
}

/* ===== Form Layout Grids ===== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 12px;
}

.form-section h3,
.form-section h4 {
    color: #6a1b9a;
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 12px;
}

/* ===== Photo Galleries ===== */
.photo-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.photo-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #ccc;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.edit-photo-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.edit-photo-item {
    text-align: center;
    font-size: 10px;
}

.edit-photo-item a {
    display: block;
    margin-top: 3px;
}

.edit-photo-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.edit-photo-item {
    width: 140px;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #f9f9f9;
    cursor: grab;
}

.edit-photo-item.dragging {
    opacity: 0.5;
}

.photo-thumb {
    width: 100%;
    border-radius: 4px;
}

.photo-actions {
    font-size: 0.85em;
    text-align: center;
}


.two-column-relations {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.relations-column h2 {
    margin-top: 0;
}

.litter-block {
    border: 1px solid #ccc;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 6px;
    background: #fafafa;
}

.litter-block h3 {
    margin-top: 0;
}

.drag-handle {
    cursor: grab;
    font-size: 18px;
    padding: 4px;
    user-select: none;
}
.edit-photo-item.dragging {
    opacity: 0.6;
}
.warning-box {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 10px;
    margin-bottom: 15px;
}

.name-thumb {
    width: 35px;
    height: 35px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
}

.dog-name {
    display: inline-flex;
    align-items: center;
}

.live-search {
    position: relative;
    max-width: 400px;
}

#dogSearch {
    width: 100%;
    padding: 8px;
    font-size: 14px;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    cursor: pointer;
}

.search-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.search-item:hover {
    background: #f2f2f2;
}
