/* assets/css/historias_ciudadanas.css */

:root {
    --atzalan-green: #198754;
    --atzalan-dark: #0f4229;
    --premium-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

body {
    background: radial-gradient(circle at top right, #f8fffb, #f1f4f9);
    min-height: 100vh;
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* Tarjeta Robusta Premium */
.story-card-compact {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.03);
    position: relative;
}

.story-card-compact:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--premium-shadow);
    border-color: var(--atzalan-green);
}

/* Contenedor Media */
.card-media-wrapper {
    width: 100%;
    height: 220px;
    background: #000;
    position: relative;
    overflow: hidden;
}

.card-media-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.7));
    pointer-events: none;
}

.card-media-wrapper img,
.card-media-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.story-card-compact:hover .card-media-wrapper img {
    transform: scale(1.15) rotate(1deg);
}

/* Badge Geo */
.badge-geo {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--atzalan-dark);
    z-index: 20;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Cuerpo de la Tarjeta */
.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-author {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--atzalan-dark);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.card-message {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.6;
    font-style: italic;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
}

/* Footer Info */
.card-footer-info {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.info-detail {
    font-size: 0.8rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-weight: 500;
}

.info-detail i {
    margin-right: 8px;
    color: var(--atzalan-green);
}

/* Botón de Acción */
.btn-view-story {
    background: linear-gradient(135deg, var(--atzalan-green), var(--atzalan-dark));
    color: #fff;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    display: block;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-view-story::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-view-story:hover::before {
    left: 100%;
}

.btn-view-story:hover {
    box-shadow: 0 5px 15px rgba(25, 135, 84, 0.4);
    color: #fff;
    transform: scale(1.02);
}

/* Iconos Sociales */
.share-icon {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
    transition: all 0.3s ease;
    text-decoration: none;
}

.share-icon.fb:hover {
    background-color: #3b5998;
    color: white;
    border-color: #3b5998;
}

.share-icon.wa:hover {
    background-color: #25d366;
    color: white;
    border-color: #25d366;
}

/* Animación de entrada */
.fade-in-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividad */
@media (max-width: 768px) {
    .story-grid {
        gap: 1rem;
    }

    .card-media-wrapper {
        height: 180px;
    }
}

/* --- ESTILOS ESPECÍFICOS PARA LA VISTA INDIVIDUAL (historia.php) --- */

:root {
    --atz-verde: #198754;
    --atz-verde-dark: #14532d;
    --atz-oro: #D4AF37;
}

.header-story {
    animation: fadeInDown 0.8s ease-out;
    border-left: 5px solid var(--atz-oro);
    padding-left: 15px;
}

.story-card-premium {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.story-media-container {
    background-color: #000;
    position: relative;
    overflow: hidden;
    height: 550px;
}

.story-media-container video,
.story-media-container img {
    transition: transform 0.5s ease;
}

.quote-icon {
    font-size: 2.5rem;
    color: var(--atz-oro);
    opacity: 0.3;
    line-height: 0;
}

.story-text {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: #2c3e50;
    line-height: 1.5;
}

.badge-premium {
    background: linear-gradient(135deg, var(--atz-verde), var(--atz-verde-dark));
    color: white;
    padding: 4px 15px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
}

.btn-atz-back {
    color: var(--atz-verde);
    border: 2px solid var(--atz-verde);
    font-weight: 700;
    transition: 0.3s;
    font-size: 0.85rem;
    text-decoration: none;
}

.btn-atz-back:hover {
    background-color: var(--atz-verde);
    color: white;
}

.author-box {
    background-color: #f8f9fa;
    border-radius: 15px;
    padding: 15px;
}

.share-pill {
    transition: transform 0.2s;
    font-size: 0.85rem;
}

.avatar-atz {
    width: 45px;
    height: 45px;
    background: var(--atz-oro);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.2rem;
}

/* Responsividad para historia.php */
@media (max-width: 768px) {
    .story-media-container {
        height: 350px;
    }

    .header-story h1 {
        font-size: 1.5rem;
    }

    .story-text {
        font-size: 1.25rem !important;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- VARIABLES Y BASES --- */
:root {
    --atz-verde: #198754;
    --atz-verde-dark: #14532d;
    --atz-oro: #D4AF37;
    --premium-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* --- VISTA DE GALERÍA (historias.php) --- */
.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.story-card-compact {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.story-card-compact:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--premium-shadow);
    border-color: var(--atz-verde);
}

.card-media-wrapper {
    width: 100%;
    height: 220px;
    background: #000;
    position: relative;
    overflow: hidden;
}

.badge-geo {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 800;
    z-index: 20;
    text-transform: uppercase;
}

/* --- VISTA INDIVIDUAL (historia.php) --- */
.header-story {
    border-left: 5px solid var(--atz-oro);
    padding-left: 15px;
}

.story-card-premium {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.story-media-container {
    background-color: #000;
    height: 550px;
    position: relative;
}

.story-text {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: #2c3e50;
    line-height: 1.5;
}

.avatar-atz {
    width: 45px;
    height: 45px;
    background: var(--atz-oro);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
}

/* --- PANTALLA DE ÉXITO (procesar_historia.php) --- */
/* Esta clase debe aplicarse al <body> de procesar_historia.php */
.body-thanks {
    background: radial-gradient(circle at center, #ffffff 0%, #f1f4f9 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.thanks-card {
    background: white;
    padding: 3rem;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    text-align: center;
    max-width: 600px;
    width: 90%;
    border-top: 8px solid var(--atz-oro);
    animation: slideUp 0.8s ease-out;
}

.icon-circle {
    width: 90px;
    height: 90px;
    background: #e8f5e9;
    color: var(--atz-verde);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
}

/* --- COMPONENTES COMPARTIDOS --- */
.share-pill {
    transition: transform 0.2s;
    font-size: 0.85rem;
}

.share-pill:hover {
    transform: scale(1.05);
}

.btn-atz-home,
.btn-view-story {
    background: var(--atz-verde);
    color: white;
    text-decoration: none;
    font-weight: 700;
    transition: 0.3s;
    border: none;
}

.btn-atz-home:hover {
    background: var(--atz-verde-dark);
    transform: translateY(-3px);
}

/* --- ANIMACIONES --- */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- RESPONSIVIDAD --- */
@media (max-width: 768px) {
    .story-media-container {
        height: 350px;
    }

    .story-grid {
        gap: 1rem;
    }

    .thanks-card {
        padding: 2rem;
    }

    .header-story h1 {
        font-size: 1.5rem;
    }
}