
/* --- Estilos para la Barra de Navegación Principal --- */
.main-nav {
    background-color: #333;
    padding: 10px 0;
    margin-bottom: 20px;
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px; /* Usa el padding del container como referencia */
}
.nav-brand {
    color: #fff;
    font-weight: bold;
    font-size: 1.5em;
    text-decoration: none;
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 15px;
}
.main-nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 1em;
}
.main-nav ul li a:hover {
    text-decoration: underline;
}   
   
   /* Estilos de dog.php*/
    /* Base para Mobile First */
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 10px;
            background-color: #f4f4f4;
            color: #333;
        }
        .container {
            width: 100%;
            max-width: 1200px;
            margin: auto;
            background-color: #fff;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
            box-sizing: border-box;
        }
        h1, h2 {
            text-align: center;
            color: #007bff;
            margin-top: 15px;
            margin-bottom: 10px;
        }
        hr {
            border: 0;
            border-top: 1px solid #eee;
            margin: 20px 0;
        }
        button {
            padding: 10px 15px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.9em;
            margin-top: 10px;
            width: 100%;
            box-sizing: border-box;
        }
        button:hover { background-color: #0056b3; }
        .message {
            margin-top: 15px; padding: 10px; border-radius: 4px; text-align: center; font-size: 0.9em;
        }
        .message.success { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }
        .message.error { background-color: #f8d7da; color: #721c24; border-color: #f5c6fb; }
        .message.info { background-color: #d1ecf1; color: #0c5460; border-color: #bee5eb; }

        /* General layout for 2 columns responsive */
        .two-column-section {
            display: flex;
            flex-direction: column; /* Stacked on mobile */
            gap: 20px;
            margin-bottom: 30px;
        }
        @media (min-width: 768px) {
            .two-column-section {
                flex-direction: row; /* Side-by-side on larger screens */
                align-items: flex-start; /* Align top */
            }
            .two-column-section > div {
                flex: 1; /* Distribute space evenly */
            }
        }

        /* Dog Header Section */
        .dog-header {
            text-align: center;
        }
        .dog-header img {
            max-width: 250px; /* Larger image for main profile */
            height: auto;
            border-radius: 8px;
            margin-bottom: 15px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        .dog-header h1 {
            margin-top: 0;
            font-size: 1.8em;
            color: #333;
        }

        /* Pedigree Section (reused from addpedigree.php) */
        .pedigree-section-header, .multimedia-section-header { /* Applied to both */
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }
        .pedigree-section-header h2, .multimedia-section-header h2 {
            margin: 0; /* Override default h2 margin */
            text-align: left; /* Align title to left */
            flex-grow: 1;
        }
        .pedigree-section-header button, .multimedia-section-header button { /* Applied to both */
            width: auto;
            padding: 8px 12px;
            font-size: 0.85em;
            margin-top: 0;
            background-color: #28a745;
        }
        .pedigree-section-header button:hover {
            background-color: #218838;
        }

        .pedigree-tree {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
            overflow: auto; /* Scroll in all directions */
            padding: 10px 0; /* Reduced padding for compact display */
            border: 1px dashed #ddd;
            min-height: 200px;
            box-sizing: border-box;
        }
        .generation {
            display: flex;
            justify-content: center;
            margin-bottom: 15px; /* Reduced margin */
            min-width: fit-content;
            padding: 0 10px; /* Reduced padding */
        }
        .dog-node-wrapper {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin: 0 5px; /* Reduced margin */
            position: relative;
            flex-shrink: 0;
        }
        .dog-node {
            border: 1px solid #ccc;
            border-radius: 5px;
            padding: 3px; /* Reduced padding */
            margin: 3px; /* Reduced margin */
            text-align: center;
            background-color: #e0e0e0;
            width: 80px; /* Smaller nodes for pedigree display */
            height: 100px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            font-size: 0.65em; /* Smaller font */
            box-sizing: border-box;
            cursor: pointer; /* Still clickable */
            transition: background-color 0.2s;
        }
        .dog-node:hover:not(.filled) { background-color: #d0d0d0; }
        .dog-node.filled { background-color: #f0f8ff; border-color: #007bff; }
        .dog-node img { max-width: 50px; max-height: 50px; border-radius: 4px; margin-bottom: 2px; object-fit: contain; }
        .dog-name { font-weight: bold; margin-bottom: 1px; }
        .dog-node .parent-label { /* Adjusted for smaller nodes */
            top: -12px; font-size: 0.6em; padding: 0 2px;
        }
        

        /* Multimedia Section Styles */
        .multimedia-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 15px;
            margin-top: 15px;
            justify-content: center;
        }
        .multimedia-item {
            border: 1px solid #eee;
            border-radius: 8px;
            padding: 10px;
            text-align: center;
            background-color: #f9f9f9;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            cursor: pointer; /* Indicate it's clickable */
        }
        .multimedia-item:hover {
             border-color: #007bff;
             background-color: #e6f7ff;
        }
        .multimedia-item img, .multimedia-item video {
            max-width: 100%;
            height: auto;
            border-radius: 4px;
            margin-bottom: 8px;
            object-fit: contain;
        }
        /* No iframe styles needed if we just show links for social_link */

        .multimedia-item .description {
            font-weight: bold;
            color: #333;
            margin: 0;
            word-break: break-word;
        }
        .multimedia-item .media-controls {
            margin-top: 10px;
        }
        .multimedia-item .external-link {
            display: block;
            margin-top: 5px;
            font-size: 0.9em;
            color: #007bff;
            text-decoration: none;
            word-break: break-all;
        }
        .multimedia-item .external-link:hover {
            text-decoration: underline;
        }
        /* Style for a small icon next to external links */
        .multimedia-item .external-link-icon {
            width: 24px;
            height: 24px;
            vertical-align: middle;
            margin-right: 5px;
            border-radius: 2px;
        }

        /* Related Dogs (Children/Siblings) Sections */
        .related-dogs-section {
            margin-top: 40px;
        }
        .related-dogs-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 15px;
            margin-top: 15px;
        }
        .related-dog-card {
            border: 1px solid #eee;
            border-radius: 8px;
            padding: 10px;
            text-align: center;
            background-color: #fff;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
            cursor: pointer;
        }
        .related-dog-card:hover {
            background-color: #f0f8ff;
            border-color: #007bff;
        }
        .related-dog-card img {
            max-width: 80px;
            max-height: 80px;
            height: auto;
            border-radius: 4px;
            margin-bottom: 5px;
            object-fit: contain;
        }
        .related-dog-card h4 {
            margin: 0;
            font-size: 0.9em;
            word-break: break-word;
        }
        .related-dog-card p {
            margin: 0;
            font-size: 0.8em;
            color: #666;
        }
        /* Modal for adding multimedia */
        .modal-multimedia {
            display: none; /* Controlled by JS */
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0,0,0,0.6);
        }
        .modal-multimedia-content {
            background-color: #fefefe;
            margin: 10% auto;
            padding: 20px;
            border: 1px solid #888;
            width: 90%;
            max-width: 500px;
            border-radius: 8px;
            position: relative;
            box-sizing: border-box;
        }
        .close-button {
            color: #aaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
        }
        .close-button:hover, .close-button:focus {
            color: black;
            text-decoration: none;
        }
        .modal-multimedia-content label {
            display: block; margin-bottom: 5px; font-weight: bold;
        }
        .modal-multimedia-content input[type="text"],
        .modal-multimedia-content input[type="url"],
        .modal-multimedia-content input[type="file"],
        .modal-multimedia-content textarea,
        .modal-multimedia-content select,
        .modal-multimedia-content input[type="checkbox"] {
            width: 100%;
            padding: 10px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box;
        }
        .modal-multimedia-content input[type="checkbox"] {
            width: auto;
            margin-right: 10px;
        }
        .modal-multimedia-content button {
            width: 100%;
            padding: 10px 15px; margin-top: 10px;
        }
        #multimediaPreview {
            max-width: 150px; max-height: 150px; margin-top: 10px; display: block; margin-bottom: 15px;
        }
        .multimedia-upload-options > div {
            border: 1px solid #eee;
            padding: 10px;
            margin-bottom: 10px;
            border-radius: 5px;
            background-color: #fcfcfc;
        }
        /* --- Fullscreen Media Modal Styles --- */
        #enlargeMediaModal {
            display: none; /* Hidden by default */
            position: fixed; /* Stay in place */
            z-index: 2000; /* Sit on top, above other modals */
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0,0,0,0.8); /* 80% black overlay */
            justify-content: center; /* Center horizontally */
            align-items: center; /* Center vertically */
        }
        #enlargeMediaContent {
            position: relative;
            max-width: 90%; /* Max width of the media */
            max-height: 90%; /* Max height of the media */
            display: flex; /* Use flex to center actual content */
            justify-content: center;
            align-items: center;
        }
        #enlargeMediaContent img, #enlargeMediaContent video {
            max-width: 100%;
            max-height: 100%;
            display: block;
            object-fit: contain; /* Ensure media fits without cropping */
        }
        #enlargeMediaContent video {
            width: auto; /* Auto width for videos to maintain aspect ratio */
            height: auto;
        }
        #closeEnlargeMediaButton {
            position: absolute;
            top: 10px;
            right: 10px;
            background: rgba(255, 255, 255, 0.3); /* Semi-transparent white */
            color: white;
            font-size: 30px;
            font-weight: bold;
            padding: 0 10px;
            border-radius: 50%;
            cursor: pointer;
            line-height: 1; /* For better 'x' alignment */
        }
        #closeEnlargeMediaButton:hover {
            background: rgba(255, 255, 255, 0.5);
        }




/* CSS de addpedigree.php*/
 /* Base para Mobile First */
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 10px;
            background-color: #f4f4f4;
            color: #333;
        }
        .container {
            width: 100%;
            max-width: 1400px;
            margin: auto;
            background-color: #fff;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
            box-sizing: border-box;
        }
        h1, h2 {
            text-align: center;
            color: #007bff;
            margin-top: 15px;
            margin-bottom: 10px;
        }
        hr {
            border: 0;
            border-top: 1px solid #eee;
            margin: 20px 0;
        }
        button {
            padding: 10px 15px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.9em;
            margin-top: 10px;
            width: 100%;
            box-sizing: border-box;
        }
        button:hover {
            background-color: #0056b3;
        }
        .message {
            margin-top: 15px;
            padding: 10px;
            border-radius: 4px;
            text-align: center;
            font-size: 0.9em;
        }
        .message.success { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }
        .message.error { background-color: #f8d7da; color: #721c24; border-color: #f5c6fb; }
        .message.info { background-color: #d1ecf1; color: #0c5460; border-color: #bee5eb; }

        /* Formulario de búsqueda superior */
        .top-search-form {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 20px;
        }
        .top-search-form input[type="text"] {
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 4px;
            font-size: 1em;
            width: 100%;
            box-sizing: border-box;
        }
        .top-search-form button {
            width: 100%;
            padding: 10px 15px;
        }
        @media (min-width: 600px) {
            .top-search-form {
                flex-direction: row;
            }
            .top-search-form input[type="text"] {
                flex-grow: 1;
                width: auto;
            }
            .top-search-form button {
                width: auto;
            }
        }


        /* Estilos del pedigrí */
        .pedigree-tree {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
            overflow: auto;
            padding: 20px 0;
            border: 1px dashed #ddd;
            min-height: 200px;
            box-sizing: border-box;
        }
        .generation {
            display: flex;
            justify-content: center;
            margin-bottom: 20px;
            min-width: fit-content;
            padding: 0 20px;
        }

        .dog-node-wrapper {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin: 0 10px;
            position: relative;
            flex-shrink: 0;
        }

        .dog-node {
            border: 1px solid #ccc;
            border-radius: 5px;
            padding: 5px;
            margin: 5px;
            text-align: center;
            background-color: #e0e0e0;
            width: 100px;
            height: 120px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            position: relative;
            font-size: 0.75em;
            box-sizing: border-box;
            cursor: pointer;
            transition: background-color 0.2s;
            flex-shrink: 0;
        }
        .dog-node:hover:not(.filled) { background-color: #d0d0d0; }
        .dog-node.filled { background-color: #f0f8ff; border-color: #007bff; }
        .dog-node img { max-width: 70px; max-height: 70px; border-radius: 4px; margin-bottom: 3px; object-fit: contain; }
        
        .dog-link {
            text-decoration: none;
            color: inherit;
            display: block;
            cursor: pointer;
        }
        .dog-link:hover .dog-name { text-decoration: underline; }

        .dog-name { font-weight: bold; margin-bottom: 2px; }
        .add-dog-button {
            background-color: #28a745;
            color: white;
            border: none;
            padding: 6px 10px;
            border-radius: 4px;
            cursor: pointer;
            margin-top: 5px;
            font-size: 0.8em;
        }
        .add-dog-button:hover { background-color: #218838; }

        /* Etiquetas Sire/Dam */
        .dog-node .parent-label {
            position: absolute;
            top: -15px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 0.7em;
            color: #666;
            background-color: #fff;
            padding: 0 3px;
            border-radius: 3px;
            z-index: 10;
        }

        /* Modal Styles (adaptados para móvil) */
        .modal {
            display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6);
        }
        .modal-content {
            background-color: #fefefe;
            margin: 10% auto;
            padding: 20px;
            border: 1px solid #888;
            width: 90%;
            max-width: 500px;
            border-radius: 8px;
            position: relative;
            box-sizing: border-box;
        }
        .close-button {
            color: #aaa; float: right; font-size: 28px; font-weight: bold;
        }
        .close-button:hover, .close-button:focus {
            color: black; text-decoration: none; cursor: pointer;
        }
        .modal-content label {
            display: block; margin-bottom: 5px; font-weight: bold;
        }
        .modal-content input[type="text"], .modal-content input[type="file"], .modal-content select, .modal-content input[type="hidden"] {
            width: 100%;
            padding: 10px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box;
        }
        .modal-content button {
            width: 100%;
            padding: 10px 15px; margin-top: 10px;
        }
        #previewImage {
            max-width: 100px; max-height: 100px; margin-top: 10px; display: block; margin-bottom: 15px;
        }
        .modal-content input:disabled, .modal-content select:disabled {
            background-color: #e9ecef; cursor: not-allowed;
        }

        /* Autocomplete styles */
        .autocomplete-container {
            position: relative;
            width: 100%;
        }
        .autocomplete-suggestions {
            position: absolute;
            z-index: 1001;
            border: 1px solid #d4d4d4;
            border-top: none;
            background-color: #fff;
            max-height: 200px;
            overflow-y: auto;
            box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
            width: calc(100% - 2px);
            left: 0;
            top: 100%;
        }
        .autocomplete-suggestions div {
            padding: 10px;
            cursor: pointer;
            border-bottom: 1px solid #d4d4d4;
            display: flex;
            align-items: center;
        }
        .autocomplete-suggestions div:hover {
            background-color: #e9e9e9;
        }
        .autocomplete-suggestions .suggestion-img {
            width: 40px;
            height: 40px;
            border-radius: 4px;
            margin-right: 10px;
            object-fit: cover;
        }
        .autocomplete-suggestions .suggestion-name {
            font-weight: bold;
        }
        .autocomplete-suggestions .suggestion-id-sex {
            font-size: 0.8em;
            color: #666;
            margin-left: auto;
        }
        .autocomplete-suggestions .none-option {
            font-style: italic;
            color: #007bff;
            justify-content: center;
            padding: 8px 10px;
            background-color: #f0f8ff;
            border-bottom: 1px solid #d4d4d4;
        }
        .autocomplete-suggestions .none-option:hover {
            background-color: #e0f0ff;
        }

        /* Alineación de botones de acción en el appSection */
        .action-buttons {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 20px;
        }
        @media (min-width: 600px) {
            .action-buttons {
                flex-direction: row;
                justify-content: space-between;
            }
            .action-buttons button {
                width: auto;
            }
        }



        /* styles para search.php */

         /* Base para Mobile First */
       
        .message {
            margin-top: 15px;
            padding: 10px;
            border-radius: 4px;
            text-align: center;
            font-size: 0.9em;
        }
        .message.success { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }
        .message.error { background-color: #f8d7da; color: #721c24; border-color: #f5c6fb; }
        .message.info { background-color: #d1ecf1; color: #0c5460; border-color: #bee5eb; }

        /* Formulario de búsqueda principal */
        .search-form {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 20px;
        }
        .search-form input[type="text"] {
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 4px;
            font-size: 1em;
            width: 100%;
            box-sizing: border-box;
        }
        .search-form button {
            width: 100%;
        }
        @media (min-width: 600px) {
            .search-form {
                flex-direction: row;
            }
            .search-form input[type="text"] {
                flex-grow: 1;
                width: auto;
            }
            .search-form button {
                width: auto;
            }
        }

        .results-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }
        .dog-card {
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 15px;
            text-align: center;
            background-color: #fff;
            box-shadow: 0 2px 5px rgba(0,0,0,0.05);
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .dog-card img {
            max-width: 200px;
            max-height: 200px;
            width: auto;
            height: auto;
            object-fit: contain;
            border-radius: 4px;
            margin-bottom: 10px;
        }
        .dog-card h3 {
            margin: 5px 0;
            font-size: 1.1em;
            word-break: break-word;
        }
        .dog-card p {
            margin: 0;
            color: #555;
            font-size: 0.9em;
        }
        .dog-card .actions {
            margin-top: 15px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            width: 100%;
        }
        .dog-card .actions button {
            width: 100%;
            padding: 8px 10px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.9em;
        }
        .dog-card .actions .edit-pedigree-btn {
            background-color: #28a745;
            color: white;
        }
        .dog-card .actions .edit-pedigree-btn:hover {
            background-color: #218838;
        }
        .dog-card .actions .view-dog-btn {
            background-color: #6c757d;
            color: white;
        }
        .dog-card .actions .view-dog-btn:hover {
            background-color: #5a6268;
        }


        /** estilos de addpedigree.php **/

         /* Base para Mobile First */
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 10px;
            background-color: #f4f4f4;
            color: #333;
        }
        .container {
            width: 100%;
            max-width: 1400px;
            margin: auto;
            background-color: #fff;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
            box-sizing: border-box;
        }
        h1, h2 {
            text-align: center;
            color: #007bff;
            margin-top: 15px;
            margin-bottom: 10px;
        }
        hr {
            border: 0;
            border-top: 1px solid #eee;
            margin: 20px 0;
        }
        button {
            padding: 10px 15px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.9em;
            margin-top: 10px;
            width: 100%;
            box-sizing: border-box;
        }
        button:hover {
            background-color: #0056b3;
        }
        .message {
            margin-top: 15px;
            padding: 10px;
            border-radius: 4px;
            text-align: center;
            font-size: 0.9em;
        }
        .message.success { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }
        .message.error { background-color: #f8d7da; color: #721c24; border-color: #f5c6fb; }
        .message.info { background-color: #d1ecf1; color: #0c5460; border-color: #bee5eb; }

        /* Formulario de búsqueda superior */
        .top-search-form {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 20px;
        }
        .top-search-form input[type="text"] {
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 4px;
            font-size: 1em;
            width: 100%;
            box-sizing: border-box;
        }
        .top-search-form button {
            width: 100%;
            padding: 10px 15px;
        }
        @media (min-width: 600px) {
            .top-search-form {
                flex-direction: row;
            }
            .top-search-form input[type="text"] {
                flex-grow: 1;
                width: auto;
            }
            .top-search-form button {
                width: auto;
            }
        }


        /* Estilos del pedigrí */
        .pedigree-tree {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
            overflow: auto;
            padding: 20px 0;
            border: 1px dashed #ddd;
            min-height: 200px;
            box-sizing: border-box;
        }
        .generation {
            display: flex;
            justify-content: center;
            margin-bottom: 20px;
            min-width: fit-content;
            padding: 0 20px;
        }

        .dog-node-wrapper {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin: 0 10px;
            position: relative;
            flex-shrink: 0;
        }

        .dog-node {
            border: 1px solid #ccc;
            border-radius: 5px;
            padding: 5px;
            margin: 5px;
            text-align: center;
            background-color: #e0e0e0;
            width: 100px;
            height: 120px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            position: relative;
            font-size: 0.75em;
            box-sizing: border-box;
            cursor: pointer;
            transition: background-color 0.2s;
            flex-shrink: 0;
        }
        .dog-node:hover:not(.filled) { background-color: #d0d0d0; }
        .dog-node.filled { background-color: #f0f8ff; border-color: #007bff; }
        .dog-node img { max-width: 70px; max-height: 70px; border-radius: 4px; margin-bottom: 3px; object-fit: contain; }
        
        .dog-link {
            text-decoration: none;
            color: inherit;
            display: block;
            cursor: pointer;
        }
        .dog-link:hover .dog-name { text-decoration: underline; }

        .dog-name { font-weight: bold; margin-bottom: 2px; }
        .add-dog-button {
            background-color: #28a745;
            color: white;
            border: none;
            padding: 6px 10px;
            border-radius: 4px;
            cursor: pointer;
            margin-top: 5px;
            font-size: 0.8em;
        }
        .add-dog-button:hover { background-color: #218838; }

        /* Etiquetas Sire/Dam */
        .dog-node .parent-label {
            position: absolute;
            top: -15px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 0.7em;
            color: #666;
            background-color: #fff;
            padding: 0 3px;
            border-radius: 3px;
            z-index: 10;
        }

        /* Modal Styles (adaptados para móvil) */
        .modal {
            display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6);
        }
        .modal-content {
            background-color: #fefefe;
            margin: 10% auto;
            padding: 20px;
            border: 1px solid #888;
            width: 90%;
            max-width: 500px;
            border-radius: 8px;
            position: relative;
            box-sizing: border-box;
        }
        .close-button {
            color: #aaa; float: right; font-size: 28px; font-weight: bold;
        }
        .close-button:hover, .close-button:focus {
            color: black; text-decoration: none; cursor: pointer;
        }
        .modal-content label {
            display: block; margin-bottom: 5px; font-weight: bold;
        }
        .modal-content input[type="text"], .modal-content input[type="file"], .modal-content select, .modal-content input[type="hidden"] {
            width: 100%;
            padding: 10px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box;
        }
        .modal-content button {
            width: 100%;
            padding: 10px 15px; margin-top: 10px;
        }
        #previewImage {
            max-width: 100px; max-height: 100px; margin-top: 10px; display: block; margin-bottom: 15px;
        }
        .modal-content input:disabled, .modal-content select:disabled {
            background-color: #e9ecef; cursor: not-allowed;
        }

        /* Autocomplete styles */
        .autocomplete-container {
            position: relative;
            width: 100%;
        }
        .autocomplete-suggestions {
            position: absolute;
            z-index: 1001;
            border: 1px solid #d4d4d4;
            border-top: none;
            background-color: #fff;
            max-height: 200px;
            overflow-y: auto;
            box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
            width: calc(100% - 2px);
            left: 0;
            top: 100%;
        }
        .autocomplete-suggestions div {
            padding: 10px;
            cursor: pointer;
            border-bottom: 1px solid #d4d4d4;
            display: flex;
            align-items: center;
        }
        .autocomplete-suggestions div:hover {
            background-color: #e9e9e9;
        }
        .autocomplete-suggestions .suggestion-img {
            width: 40px;
            height: 40px;
            border-radius: 4px;
            margin-right: 10px;
            object-fit: cover;
        }
        .autocomplete-suggestions .suggestion-name {
            font-weight: bold;
        }
        .autocomplete-suggestions .suggestion-id-sex {
            font-size: 0.8em;
            color: #666;
            margin-left: auto;
        }
        .autocomplete-suggestions .none-option {
            font-style: italic;
            color: #007bff;
            justify-content: center;
            padding: 8px 10px;
            background-color: #f0f8ff;
            border-bottom: 1px solid #d4d4d4;
        }
        .autocomplete-suggestions .none-option:hover {
            background-color: #e0f0ff;
        }

        /* Alineación de botones de acción en el appSection */
        .action-buttons {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 20px;
        }
        @media (min-width: 600px) {
            .action-buttons {
                flex-direction: row;
                justify-content: space-between;
            }
            .action-buttons button {
                width: auto;
            }
        }


/** styles de share.php **/

/* === Panel de búsqueda global bajo la barra === */
.bp-searchbar {
  display: none;
  background: #fff;
  border-bottom: 1px solid #e6e6e6;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  padding: 12px 16px;
  position: relative;
  z-index: 50;
}
.bp-searchbar[hidden] { display: none; }
.bp-searchbar:not([hidden]) { display: block; }

.bp-searchbar__inner {
  display: flex;
  gap: 8px;
  align-items: center;
}

#globalSearchInput {
  flex: 1;
  height: 36px;
  padding: 6px 10px;
  border: 1px solid #dcdcdc;
  border-radius: 6px;
}

.bp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: #1a73e8;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
.bp-btn:hover { filter: brightness(0.95); }
.bp-btn--outline {
  background: #fff;
  color: #1a73e8;
  border-color: #1a73e8;
}
.bp-btn--small { height: 28px; padding: 0 10px; font-size: 0.9em; }

/* Dropdown de sugerencias */
.bp-suggest {
  margin-top: 8px;
  border: 1px solid #e6e6e6;
  background: #fff;
  border-radius: 8px;
  max-height: 280px;
  overflow: auto;
  display: none;
}
.bp-suggest[style*="display: block"] { display: block; } /* mantener compatibilidad con JS actual */

.bp-suggest__item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #f2f2f2;
}
.bp-suggest__item:last-child { border-bottom: 0; }

.bp-suggest__thumb {
  width: 40px; height: 40px;
  object-fit: cover; border-radius: 6px;
}

.bp-suggest__title {
  display: flex; flex-direction: column;
}
.bp-suggest__name { font-weight: 600; }
.bp-suggest__sub { opacity: .65; font-size: .85em; }

.bp-suggest__actions {
  display: inline-flex; gap: 6px;
}
