* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root{
    --primary: #2f5d50;
    --primary-dark: #244a3f;
    --secondary: #6f9b8d;
    --accent: #d7e7df;

    --bg-page: #f6f4ee;
    --bg-soft: #eef3f0;
    --bg-soft-2: #f7faf8;
    --bg-card: #ffffff;

    --text-main: #24312c;
    --text-soft: #52615a;
    --border-soft: #d6e1db;

    --shadow-soft: 0 8px 24px rgba(36, 49, 44, 0.08);
    --shadow-hover: 0 12px 28px rgba(36, 49, 44, 0.12);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
}

html{
    background-color: var(--bg-page);
}

body {
    background: var(--bg-page);
    font-family: 'Roboto', Arial, sans-serif;
    color: var(--text-main);
    margin: 0 auto;
    max-width: 1400px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/**************************************************************/
/*-------------- HEADER ------------------------------------- */
/**************************************************************/

header{
    background: linear-gradient(135deg, #2f5d50, #2a6656);
    color: #fff;
    margin: 0 auto;
    min-width: 100%;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
}

header h1{
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 700;
    padding: 1.15em 1em;
    line-height: 1.2;
}

/**************************************************************/
/*-------------- NAV ---------------------------------------- */
/**************************************************************/

@media only screen and (min-width:500px){
    .menu{
        display: none;
    }
}

@media only screen and (max-width:500px){
    .navhidden{
        display: none;
    }
}

.navbar {
    overflow: hidden;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 4px 12px rgba(36, 49, 44, 0.05);
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 4px 6px;
}

.navbar a {
    float: left;
    font-size: 15px;
    color: var(--text-main);
    text-align: center;
    padding: 12px 14px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-radius: 10px;
    margin: 4px;
}

.menu {
    float: left;
    overflow: hidden;
}

.menu .menubtn {
    font-size: 15px;
    border: none;
    outline: none;
    color: var(--text-main);
    padding: 12px 14px;
    background-color: inherit;
    font-family: inherit;
    margin: 4px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
}

.navbar a:hover,
.menu .menubtn:hover{
    background-color: var(--bg-soft);
    color: var(--primary);
}

.menu-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 220px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(36,49,44,0.12);
    z-index: 30;
    overflow: hidden;
}

.menu-content a {
    float: none;
    color: var(--text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    margin: 0;
    border-radius: 0;
}

.menu-content a:hover {
    background-color: var(--bg-soft);
    color: var(--primary);
}

.menu:hover .menu-content {
    display: block;
}

nav hr{
    box-sizing: content-box;
    height: 0;
}

/**************************************************************/
/*-------------- CONTENIDO GENERAL -------------------------- */
/**************************************************************/

.text{
    overflow: auto;
    font-family: 'Roboto', Arial, sans-serif;
    padding: 1.5em 1em 2.5em 1em;
}

.description{
    margin-top: 1.4em;
    padding: 2em;
    text-align: left;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.description h1{
    word-wrap: break-word;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 0.8em;
    color: var(--primary-dark);
    line-height: 1.2;
}

.description h2,
h2{
    color: var(--primary);
    margin-top: 0.8em;
    margin-bottom: 0.6em;
    font-size: 24px;
    font-weight: 700;
}

p{
    word-wrap: break-word;
    color: var(--text-main);
    font-size: 16px;
    line-height: 1.65;
    margin: 0 0 0.9em 0;
    padding: 1em 1.1em;
    text-align: left;
    background-color: var(--bg-soft);
    border-radius: 12px;
}

ul, ol{
    margin: 0.8em 0 1em 1.5em;
    color: var(--text-main);
    line-height: 1.6;
}

li{
    margin-bottom: 0.4em;
}

a{
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover{
    color: var(--primary-dark);
    text-decoration: underline;
}

label{
    color: var(--text-main);
    font-weight: 600;
}

input,
select,
textarea{
    width: 100%;
    max-width: 520px;
    padding: 0.75em 0.9em;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-main);
    font-size: 15px;
    margin-top: 0.45em;
    margin-bottom: 0.35em;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus{
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(111, 155, 141, 0.18);
}

button{
    background-color: var(--primary);
    border: none;
    color: #fff;
    padding: 0.82em 1.2em;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
    box-shadow: 0 6px 14px rgba(47, 93, 80, 0.18);
}

button:hover{
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

button:disabled{
    background-color: #acbbb4;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/**************************************************************/
/*-------------- HISTORIAL / TARJETAS AUX ------------------- */
/**************************************************************/

.history-card{
    margin-bottom: 1.5em;
    padding: 1.2em;
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
}

.history-card-header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1em;
    margin-bottom: 1em;
}

.history-card-title{
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0;
}

.history-meta{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 1em;
}

.history-meta-item{
    background: var(--bg-soft);
    border-radius: 12px;
    padding: 0.9em 1em;
    color: var(--text-main);
}

.history-sections{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
}

.history-section{
    background: var(--bg-soft-2);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 1em;
}

.history-section h3{
    margin: 0 0 0.7em 0;
    color: var(--primary);
    font-size: 18px;
}

.history-section ul,
.history-section ol{
    margin: 0 0 0 1.2em;
}

.history-section li{
    margin-bottom: 0.45em;
}

.delete-prediction-btn{
    border: 1px solid #c7d3cd !important;
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    background: #ffffff !important;
    color: var(--primary) !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-shadow: 0 4px 10px rgba(36, 49, 44, 0.10);
    flex-shrink: 0;
}

.delete-prediction-btn:hover{
    background: var(--bg-soft) !important;
    color: var(--primary-dark) !important;
    transform: none !important;
}

@media (max-width: 900px){
    .history-meta{
        grid-template-columns: 1fr;
    }

    .history-sections{
        grid-template-columns: 1fr;
    }
}

/**************************************************************/
/*-------------- AVES / GALERÍA ----------------------------- */
/**************************************************************/

.bird{
    position: relative;
    width: 210px;
    height: 130px;
    background: #edf3ef;
    margin: 20px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(36,49,44,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bird:hover{
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.bird img{
    display: block;
    margin-left: auto;
    margin-right: auto;
    border-radius: 14px;
    border: 2px solid var(--secondary);
    width: 100%;
    max-width: 180px;
    height: 110px;
    object-fit: cover;
    margin-top: 10px;
}

.overlay {
    position: absolute;
    bottom: 0;
    background: rgba(36, 49, 44, 0.72);
    width: 100%;
    transition: .3s ease;
    opacity: 0;
    color: white;
    font-size: 18px;
    text-align: center;
    padding: 0.6em;
}

.bird:hover .overlay{
    opacity: 1;
}

/**************************************************************/
/*-------------- FOOTER ------------------------------------- */
/**************************************************************/

footer{
    width: 100%;
    padding: 28px 0 36px 0;
}

#pie_pagina{
    max-width: 1200px;
    margin: auto;
    text-align: center;
    padding: 0 40px;
}

#pie_pagina hr{
    border: none;
    height: 1px;
    background-color: var(--border-soft);
    margin-bottom: 18px;
}

footer #imgucm{
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    padding: 1%;
}

footer #name{
    margin: 0 auto;
    float: left;
    max-width: 40%;
    padding: 1%;
    color: var(--text-soft);
}

footer #creativecommons{
    margin: 0 auto;
    float: left;
    padding: 1%;
}

@media (max-width: 768px){
    .text{
        padding: 1em 0.75em 2em 0.75em;
    }

    .description{
        padding: 1.25em;
        border-radius: 14px;
    }

    .description h1{
        font-size: 24px;
    }

    p{
        padding: 0.9em;
    }

    header{
        border-bottom-left-radius: 14px;
        border-bottom-right-radius: 14px;
    }
}
