/**
 * Generador de Cuentos - Estilos principales
 */

/* Estilos generales */
.gc-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.gc-titulo {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2563eb;
}

.gc-subtitulo {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #1f2937;
}

/* Formulario */
.gc-form {
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.gc-form-group {
    margin-bottom: 1rem;
}

.gc-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.gc-input,
.gc-select,
.gc-textarea {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out;
}

.gc-input:focus,
.gc-select:focus,
.gc-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.gc-textarea {
    resize: vertical;
    min-height: 100px;
}

.gc-checkbox-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
}

.gc-checkbox {
    margin-right: 0.5rem;
    width: 1.25rem;
    height: 1.25rem;
}

/* Botones */
.gc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, transform 0.1s ease-in-out;
}

.gc-button:hover {
    transform: translateY(-1px);
}

.gc-button:active {
    transform: translateY(1px);
}

.gc-button i,
.gc-button svg {
    margin-right: 0.5rem;
}

.gc-button-primary {
    background-color: #2563eb;
    color: white;
}

.gc-button-primary:hover {
    background-color: #1d4ed8;
}

.gc-button-secondary {
    background-color: #4b5563;
    color: white;
}

.gc-button-secondary:hover {
    background-color: #374151;
}

.gc-button-success {
    background-color: #10b981;
    color: white;
}

.gc-button-success:hover {
    background-color: #059669;
}

.gc-button-danger {
    background-color: #ef4444;
    color: white;
}

.gc-button-danger:hover {
    background-color: #dc2626;
}

.gc-button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}

/* Cargando */
.gc-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.gc-spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid rgba(59, 130, 246, 0.25);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: gc-spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes gc-spin {
    to {
        transform: rotate(360deg);
    }
}

.gc-loading-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: #3b82f6;
    animation: gc-pulse 1.5s infinite;
}

@keyframes gc-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Resultado */
.gc-resultado {
    display: none;
    margin-top: 2rem;
}

.gc-imagen-container {
    position: relative;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.gc-imagen-preview {
    display: block;
    width: 100%;
    height: auto;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
}

.gc-imagen-preview:hover {
    transform: scale(1.02);
}

.gc-floating-download {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, transform 0.15s ease-in-out;
    z-index: 10;
}

.gc-floating-download:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.gc-cuento-container {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    line-height: 1.6;
}

.gc-cuento-titulo {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1rem;
    color: #1f2937;
}

.gc-cuento-container p {
    margin-bottom: 1rem;
}

.gc-cuento-ensenanza {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.gc-cuento-ensenanza h3 {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

/* Acciones */
.gc-acciones {
    display: none;
    margin-top: 1.5rem;
}

/* Votación */
.gc-votacion {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the like/dislike buttons */
    gap: 0.5rem;
    margin-top: 1rem;
}

.gc-votacion-count {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    border-radius: 1rem;
    padding: 0.25rem 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.gc-votacion-count.popular {
    background-color: #fef3c7;
    color: #d97706;
}

.gc-votacion-count.trending-up {
    background-color: #d1fae5;
    color: #059669;
}

.gc-votacion-count.trending-down {
    background-color: #fee2e2;
    color: #dc2626;
}

.gc-votacion-count i {
    margin-right: 0.25rem;
}

.gc-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
}

.gc-filtro-select {
    flex: 1;
    min-width: 150px;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: white;
    font-size: 0.875rem;
}

.gc-like-button,
.gc-dislike-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.gc-like-button {
    background-color: #ecfdf5;
    color: #10b981;
}

.gc-like-button:hover {
    background-color: #d1fae5;
}

.gc-dislike-button {
    background-color: #fef2f2;
    color: #ef4444;
}

.gc-dislike-button:hover {
    background-color: #fee2e2;
}

.gc-like-count,
.gc-dislike-count {
    margin-left: 0.25rem;
    font-weight: 600;
}

/* Lista de cuentos */
.gc-lista-cuentos {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gc-cuento-item {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.3s ease-in-out;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gc-cuento-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.gc-cuento-item-imagen {
    position: relative;
    overflow: hidden;
    border-radius: 0.375rem;
    margin-bottom: 0rem; /* No spacing below image */
    aspect-ratio: 1/1; /* Square aspect ratio for 300x300 proportion */
    height: 300px; /* Set fixed height to 300px */
    width: 300px; /* Set fixed width */
    margin-left: auto;
    margin-right: auto;
}

.gc-cuento-item-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gc-cuento-item:hover .gc-cuento-item-imagen img {
    transform: scale(1.05);
}

.gc-cuento-item-acciones {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 1rem 0.5rem 0.5rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease;
}

.gc-cuento-item:hover .gc-cuento-item-acciones {
    opacity: 1;
    transform: translateY(0);
}

.gc-cuento-item-titulo {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2563eb;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gc-cuento-item-meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.gc-cuento-item-extracto {
    margin-bottom: 1rem;
    color: #4b5563;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gc-cuento-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
}

.gc-cuento-item-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
}

.gc-cuento-item-link:hover {
    text-decoration: underline;
}

/* Modal */
.gc-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear 0.25s, opacity 0.25s linear;
}

.gc-modal-active {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

.gc-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    cursor: pointer;
}

.gc-modal-content {
    position: relative;
    background-color: white;
    border-radius: 0.5rem;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    z-index: 51;
}

.gc-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    z-index: 52;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
}

.gc-modal-close:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.gc-modal-image {
    display: block;
    max-width: 100%;
    max-height: 80vh;
}

.gc-modal-footer {
    padding: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Mensajes */
.gc-error {
    color: #dc2626;
    padding: 1rem;
    background-color: #fee2e2;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.gc-success {
    color: #059669;
    padding: 1rem;
    background-color: #d1fae5;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

/* Estados */
.gc-copied {
    background-color: #10b981 !important;
}

/* Responsive */
@media (max-width: 1920px) {
    .gc-container {
        max-width: 1600px;
    }
    .gc-lista-cuentos {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .gc-container {
        max-width: 960px;
    }
    .gc-lista-cuentos {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .gc-container {
        max-width: 100%;
        padding: 0.75rem;
    }
    .gc-lista-cuentos {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .gc-button-group {
        flex-direction: column;
    }
    .gc-button {
        width: 100%;
    }
    .gc-floating-download {
        width: 2rem;
        height: 2rem;
        bottom: 0.5rem;
        right: 0.5rem;
    }
    .gc-titulo {
        font-size: 1.5rem;
    }
    .gc-subtitulo {
        font-size: 1.25rem;
    }
}