:root {
    --primary-color: #4da6ff;
    --secondary-color: #e6f5ff;
    --accent-color: #a8d5ff;
    --dark-color: #1e3d59;
    --light-color: #f9fcff;
    --text-color: #4a4a4a;
    --urgent-color: #ff4d4d;
    --success-color: #4CAF50;
    --border-radius: 16px;
    --box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    --primary-gradient: linear-gradient(135deg, #4da6ff, #1e6fb9);
}

.emergencias-content {
    position: relative;
    padding: 50px;
    max-width: 1200px;
    margin: 20px auto;
    transition: padding 0.5s ease;
}

.adopcion-background {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.adopcion-background::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 90%;
    height: 6px;
    background: linear-gradient(90deg, #ff4444, #ff7777, #ff4444);
    transform: translateX(-50%);
    border-radius: 50px;
    opacity: 0.9;
}

.animate-fade-in { opacity: 0; animation: fadeIn 0.8s ease forwards; }
.animate-slide-up { opacity: 0; transform: translateY(30px); animation: slideUp 0.8s ease forwards; }
.animate-slide-left { opacity: 0; transform: translateX(-50px); animation: slideLeft 0.8s ease forwards; }
.animate-slide-right { opacity: 0; transform: translateX(50px); animation: slideRight 0.8s ease forwards; }
.animate-pulse { animation: subtlePulse 2s infinite ease-in-out; }
.animate-heartbeat { animation: heartbeat 2s infinite ease-in-out; }
@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); } 
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideLeft { from { opacity: 0; transform: translateX(-50px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideRight { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } }
@keyframes subtlePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 10%, 30% { transform: scale(1.1); } 20%, 40% { transform: scale(1); } }

.intro-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 50px 30px;
    position: relative;
    background: rgba(255, 68, 68, 0.05);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

.intro-section:hover {
    box-shadow: var(--hover-shadow);
}

.intro-box {
    flex: 1 1 50%;
    padding: 40px;
    background: var(--light-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
}

.intro-box:hover {
    transform: translateY(-5px);
}

.intro-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: var(--urgent-color);
    margin-bottom: 15px;
}

.intro-text {
    font-family: 'Roboto', sans-serif;
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 25px;
    line-height: 1.6;
}

.intro-btn {
    background: var(--primary-gradient);
    color: white;
    font-size: 1.1rem;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: url(/assets/images/Cursor/Cursor2_1.ico) 16 16, auto;
    transition: all 0.3s ease;
}

.intro-btn:hover {
    background: linear-gradient(135deg, #1e6fb9, #4da6ff);
    transform: scale(1.05);
    box-shadow: var(--hover-shadow);
}

.intro-image {
    flex: 1 1 40%;
    min-width: 300px;
    margin: 0 10px;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.intro-image:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.intro-image img {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 2px solid var(--urgent-color);
}

.reality-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 60px 20px;
    background: var(--light-color);
    border-radius: var(--border-radius);
    margin: 40px 0;
}

.reality-content {
    flex: 1 1 50%;
    padding: 20px;
}

.reality-content .section-title {
    color: var(--dark-color);
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.reality-content .section-text {
    font-size: 1.2rem;
    color: var(--text-color);
    line-height: 1.6;
    font-weight: 600;
}

.reality-image {
    flex: 1 1 40%;
    padding: 20px;
}

.reality-image img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 2px solid var(--urgent-color);
    transition: transform 0.5s ease, filter 0.5s ease;
}

.reality-image:hover img {
    transform: scale(1.05) rotate(2deg);
    filter: brightness(1.1);
}

.emergencies-section {
    padding: 40px 20px;
    text-align: center;
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    margin: 40px 0;
}

.emergencies-section .section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    color: var(--urgent-color);
    text-shadow: 2px 2px 8px rgba(255, 77, 77, 0.3);
    position: relative;
    display: inline-block;
    padding: 0 20px;
    background: linear-gradient(135deg, rgba(255, 77, 77, 0.1), rgba(255, 255, 255, 0.8));
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.emergencies-section .section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    width: 60%;
    height: 4px;
    background: var(--urgent-color);
    transform: translateX(-50%);
    border-radius: 2px;
}

.emergencies-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
}

.emergency-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    width: 300px;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.emergency-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--hover-shadow);
    border: 2px solid var(--urgent-color);
}

.emergency-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
    border: 2px solid var(--urgent-color);
}

.emergency-info {
    padding: 15px 0;
}

.emergency-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--dark-color);
    margin-bottom: 10px;
    text-align: center;
}

.needs-list {
    list-style: none;
    padding: 0 0 0 20px;
    text-align: left;
}

.need-item-wrapper {
    position: relative;
    padding: 10px 0;
}

.need-item-wrapper:last-child {
    padding-bottom: 0;
}

.need-item-wrapper:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgb(21, 21, 21);
    opacity: 0.6;
}

.need-item {
    font-size: 1.1rem;
    color: rgb(189, 0, 0);
    padding-left: 20px;
    position: relative;
    line-height: 1.5;
}

.need-item::before {
    content: "⚠️";
    position: absolute;
    left: -20px;
    color: var(--urgent-color);
}

.need-item.completed {
    text-decoration: line-through;
    color: var(--success-color);
}

.need-item.completed::before {
    content: "✔️";
    color: var(--success-color);
}

.image-preview img,
#newImagePreview img {
    max-width: 200px;
    max-height: 200px;
    display: block;
    margin-top: 10px;
}

.edit-controls {
    display: none;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid var(--accent-color);
}

.edit-controls.visible {
    display: block;
}

input[type="file"] {
    display: block;
}

.edit-controls input[type="text"],
.edit-controls input[type="file"],
.edit-controls input[type="number"] {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid var(--secondary-color);
    border-radius: 4px;
}

.edit-controls .needs-edit {
    margin: 10px 0;
}

.edit-controls .need-edit {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 10px 0;
}

.edit-controls .need-edit .need-inputs {
    display: flex;
    gap: 10px;
}

.edit-controls .need-edit input[type="checkbox"] {
    margin-top: 5px;
}

.edit-controls button {
    background: var(--primary-gradient);
    color: white;
    padding: 8px 15px;
    border-radius: 50px;
    cursor: url(/assets/images/Cursor/Cursor2_1.ico) 16 16, auto;
    transition: all 0.3s ease;
    margin: 5px 0;
}

.edit-controls button:hover {
    background: linear-gradient(135deg, #1e6fb9, #4da6ff);
    transform: scale(1.05);
}

.hidden {
    display: none;
}

.emergencies-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    transition: all 0.3s ease;
}

.custom-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.custom-popup h3 {
    margin: 0 0 10px;
    color: #333;
    font-family: 'Playfair Display', serif;
}

.custom-popup p {
    margin: 0 0 20px;
    color: #666;
    font-family: 'Roboto', sans-serif; 
}

.custom-popup .close-btn {
    background: #e63946;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: url(/assets/images/Cursor/Cursor2_1.ico) 16 16, auto;
    font-family: 'Roboto', sans-serif; 
}

.custom-popup .close-btn:hover {
    background: #d62828; 
}

.custom-popup button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: url(/assets/images/Cursor/Cursor2_1.ico) 16 16, auto;
    margin-right: 10px;
}

.custom-popup .confirm-btn {
    background: #2ecc71;
    color: white;
}

.custom-popup .cancel-btn {
    background: #e63946;
    color: white;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.order-input {
    width: 60px;
    padding: 5px;
    margin-bottom: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
}

.emergency-card.dragging {
    opacity: 0.5;
    border: 2px dashed #ccc;
}

.promise-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 60px 20px;
    background: var(--light-color);
    border-radius: var(--border-radius);
    margin: 40px 0;
}

.promise-content {
    flex: 1 1 50%;
    padding: 20px;
}

.promise-content .section-title {
    color: var(--dark-color);
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.promise-content .section-text {
    font-size: 1.2rem;
    color: var(--text-color);
    line-height: 1.6;
}

.promise-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: url(/assets/images/Cursor/Cursor2_1.ico) 16 16, auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    margin-top: 20px;
}

.promise-btn:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 5px 15px rgba(77, 166, 255, 0.5);
    background: linear-gradient(135deg, #2a7db8, #4da6ff);
}

.promise-image {
    flex: 1 1 40%;
    padding: 20px;
}

.promise-image img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.5s ease, filter 0.5s ease;
}

.promise-image:hover img {
    transform: scale(1.05) rotate(2deg);
    filter: brightness(1.1);
}

@media (max-width: 768px) {
    .intro-section, .reality-section, .promise-section { flex-direction: column; padding: 20px 10px; }
    .intro-box, .reality-content, .promise-content { flex: 1 1 100%; margin: 0; }
    .intro-image, .reality-image, .promise-image { flex: 1 1 100%; margin: 20px 0; }
    .emergency-card { width: 44%; }
    .emergencies-section {padding: 40px 0px;}
}

@media (max-width: 598px){
    .emergencias-content {
        padding: 10px;
    }
    .intro-image img {
        max-height: 190px;
    }
    .intro-title{
        font-size: 1.7rem;
    }
    .intro-text{
        font-size: 1.1rem;
    }
    .reality-content .section-title{
        font-size: 1.7rem;
    }
    .reality-content .section-text{
        font-size: 1rem;
        font-weight: 450;
    }
    .reality-image img, .promise-image img{
        max-height: 280px;
    }
    .reality-section, .emergencies-section, .promise-section{
        margin: 10px 0;
    }
    .emergency-card{
        width: 45%;
    }
    .emergency-image img{
        height: 160px;
    }
    .emergency-name {
        font-size: 1.4rem;
    }
    .need-item {
        font-size: 0.85rem;
        padding-left: 0px;
    }
    .need-item::before {
        left: -30px;
    }
    .emergencies-section .section-title{
        font-size: 2rem;
    }
    .promise-content .section-title {
        font-size: 1.7rem;
        margin-bottom: 10px;
    }
    .promise-content .section-text{
        font-size: 1.1rem;
    }
}