/* --- LAYOUT GENERAL --- */
.container-home {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    color: white;
}

.header-modern {
    text-align: center;
    margin-bottom: 40px;
}

.header-modern h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #a0a4c0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.header-modern p {
    color: #a0a4c0;
    font-size: 1.1rem;
}

/* --- ÁREA DE INPUT --- */
.input-card-wrapper {
    max-width: 800px;
    margin: 0 auto 50px auto;
    background: #13161c;
    border: 1px solid #2d3436;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.input-group-solid textarea {
    width: 100%;
    height: 150px;
    background: #0b0e14;
    border: 1px solid #2d3436;
    border-radius: 8px;
    color: white;
    padding: 15px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    outline: none;
    transition: 0.2s;
}

.input-group-solid textarea:focus {
    border-color: #7c8cff;
    box-shadow: 0 0 0 2px rgba(124, 140, 255, 0.1);
}

/* --- BOTONES --- */
.btn-primary-solid {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    background: #7c8cff;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary-solid:hover {
    background: #6b7be0;
    transform: translateY(-1px);
}

.btn-primary-solid:disabled {
    background: #4a4d5a;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #2d3436;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 15px;
    width: 100%;
    transition: 0.2s;
}
.btn-secondary:hover { background: #3d4548; }

/* --- GRID DE TARJETAS (Donde ocurre la magia) --- */
.flashcards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding-bottom: 50px;
}

.flashcard-wrapper {
    perspective: 1000px; /* Necesario para el efecto 3D */
    position: relative;
}

/* CHECKBOX DE SELECCIÓN */
.checkbox-wrapper {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-select-cb {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #7c8cff;
}

/* --- TARJETA FLIP --- */
.flashcard {
    background-color: transparent;
    width: 100%;
    height: 220px; /* Altura fija para que no colapse */
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

/* Clase que JS añade para rotar */
.flashcard.flipped .card-inner {
    transform: rotateY(180deg);
}

/* CARAS DE LA TARJETA */
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 1px solid #2d3436;
    overflow-y: auto; /* Scroll si el texto es muy largo */
}

/* ESTILO CARA DELANTERA */
.card-front {
    background-color: #1a1d26;
    color: #fff;
}
.card-front p {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.5;
}

/* ESTILO CARA TRASERA */
.card-back {
    background-color: #252a36; /* Un poco más clara para diferenciar */
    color: #e0e0e0;
    transform: rotateY(180deg);
    border-color: #7c8cff; /* Borde de color al girar */
}
.card-back p {
    font-size: 1rem;
    line-height: 1.6;
}

/* --- PANEL DE GUARDADO --- */
.save-panel {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #2d3436;
    animation: fadeIn 0.5s ease;
}

.save-options {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.option-group {
    flex: 1;
    background: #0b0e14;
    border: 1px solid #2d3436;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.option-group.selected {
    border-color: #7c8cff;
    background: rgba(124, 140, 255, 0.05);
}

.option-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    margin-bottom: 10px;
}

.input-field {
    width: 100%;
    background: #13161c;
    border: 1px solid #2d3436;
    padding: 8px 12px;
    border-radius: 6px;
    color: white;
}
.mt-2 { margin-top: 8px; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}