/* Estilos para site de historinhas infantis */

:root {
    --primary-color: #FF6B9D;
    --secondary-color: #FEC260;
    --success-color: #4ECDC4;
    --info-color: #95E1D3;
    --light-bg: #FFF8F3;
    --dark-text: #2C3E50;
    --purple: #9B59B6;
    --blue: #3498DB;
    --green: #2ECC71;
    --orange: #E67E22;
}

body {
    font-family: 'Segoe UI', 'Comic Sans MS', 'Roboto', 'Arial', sans-serif;
    background: linear-gradient(135deg, #FFF8F3 0%, #FFE8F0 100%);
    background-attachment: fixed;
    color: var(--dark-text);
    min-height: 100vh;
    position: relative;
}

/* Elementos decorativos de fundo */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    opacity: 0.05;
    z-index: -1;
    pointer-events: none;
}

body::before {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    top: -100px;
    right: -100px;
    animation: float 20s ease-in-out infinite;
}

body::after {
    width: 300px;
    height: 300px;
    background: var(--secondary-color);
    bottom: -80px;
    left: -80px;
    animation: float 15s ease-in-out infinite reverse;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #C44569 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

.nav-link {
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 20px;
    padding: 8px 16px !important;
    margin: 0 4px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Cards */
.card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    background: white;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.1) 0%, rgba(254, 194, 96, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.card:hover::before {
    opacity: 1;
}

.card-img-top {
    height: 200px;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.5s ease;
}

.card:hover .card-img-top {
    transform: scale(1.1);
}

.card-title {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

.card-body {
    position: relative;
    z-index: 1;
}

/* Card com gradiente de fundo quando não há imagem */
.card .bg-gradient {
    animation: gradientShift 10s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background: linear-gradient(135deg, #FF6B9D 0%, #FEC260 100%); }
    25% { background: linear-gradient(135deg, #4ECDC4 0%, #95E1D3 100%); }
    50% { background: linear-gradient(135deg, #9B59B6 0%, #E74C3C 100%); }
    75% { background: linear-gradient(135deg, #3498DB 0%, #2ECC71 100%); }
}

/* Botões */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #C44569 100%);
    border: none;
    border-radius: 25px;
    padding: 10px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 107, 157, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px) scale(1.02);
}

.btn-outline-secondary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 25px;
    padding: 10px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-outline-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    transition: left 0.4s ease;
    z-index: -1;
}

.btn-outline-secondary:hover {
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-outline-secondary:hover::before {
    left: 0;
}

/* Botões com ícones animados */
.btn i {
    transition: transform 0.3s ease;
    display: inline-block;
}

.btn:hover i {
    transform: scale(1.2) rotate(5deg);
}

/* Títulos */
h1, h2, h3 {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

/* Conteúdo do artigo */
.conteudo {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #34495E;
}

.conteudo p {
    margin-bottom: 1.5rem;
}

.conteudo img {
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Footer */
footer {
    background: linear-gradient(135deg, #F5F7FA 0%, #E8EBF0 100%);
    border-top: 4px solid var(--secondary-color);
    margin-top: 60px;
}

/* Tags */
.badge {
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: 600;
    margin-right: 8px;
    margin-bottom: 8px;
    display: inline-block;
}

.badge-tag {
    background: linear-gradient(135deg, var(--success-color) 0%, var(--info-color) 100%);
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
}

.badge-tag:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.5);
    text-decoration: none;
    color: white;
}

/* Animações */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Breadcrumbs */
.breadcrumb {
    background: white;
    border-radius: 20px;
    padding: 15px 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

.breadcrumb-item {
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.3rem;
    color: var(--primary-color);
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #C44569;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--dark-text);
}

/* Responsividade */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .card-img-top {
        height: 150px;
    }

    .navbar-brand {
        font-size: 1.4rem;
    }
}

/* Lista de categorias/tags */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.category-item {
    background: white;
    padding: 25px;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.15) 0%, rgba(254, 194, 96, 0.15) 100%);
    border-radius: 30px;
    padding: 50px 40px;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 3px solid transparent;
    background-clip: padding-box;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--success-color), var(--info-color));
    border-radius: 30px;
    z-index: -1;
    opacity: 0.3;
    filter: blur(10px);
}

.hero-section h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShine 3s ease-in-out infinite;
}

@keyframes textShine {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.hero-section p {
    font-size: 1.3rem;
    color: #5A6C7D;
    font-weight: 500;
}

.hero-section i {
    font-size: 3.5rem;
    animation: float 3s ease-in-out infinite;
}

/* Sidebar */
.sidebar {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    position: sticky;
    top: 90px;
}

.sidebar h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--secondary-color);
    color: var(--primary-color);
}

.sidebar-item {
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--dark-text);
    background: linear-gradient(135deg, #F8F9FA 0%, #E9ECEF 100%);
}

.sidebar-item:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, #C44569 100%);
    color: white;
    transform: translateX(10px);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
}

.sidebar-item i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.sidebar-item .count {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

/* Container geral do formulário */
#formEmail {
    max-width: 600px;
    margin: 60px auto; /* centraliza horizontalmente */
    padding: 30px 40px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fafafa;
}

/* Cada linha do formulário (simula linha de tabela) */
#formEmail p {
    display: grid;
    grid-template-columns: 180px 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

/* Labels */
#formEmail label {
    text-align: right;
    font-weight: 600;
    color: #333;
}

/* Campos de input, textarea, select */
#formEmail input[type="text"],
#formEmail input[type="email"],
#formEmail input[type="password"],
#formEmail textarea,
#formEmail select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* Textarea mais confortável */
#formEmail textarea {
    min-height: 120px;
    resize: vertical;
}

/* Help text */
#formEmail .small {
    grid-column: 2;
    margin-top: -8px;
}

/* Mensagens de erro */
#formEmail .errorlist {
    grid-column: 2;
    color: #c00;
    font-size: 13px;
}

/* Botão centralizado */
#formEmail input[type="submit"] {
    grid-column: 1 / 3;
    padding: 10px 30px;
    font-size: 15px;
    cursor: pointer;
}

/* Alerts (messages framework) */
[class^="alert-"] {
    max-width: 600px;
    margin: 20px auto;
    padding: 12px;
    border-radius: 4px;
    text-align: center;
}

.alert-error {
    background: #ffecec;
    color: #900;
    border: 1px solid #f5c2c2;
}

.alert-success {
    background: #e7f7e7;
    color: #0a5;
    border: 1px solid #bde5bd;
}

/* Responsivo (mobile) */
@media (max-width: 640px) {
    #formEmail p {
        grid-template-columns: 1fr;
    }

    #formEmail label {
        text-align: left;
    }

    #formEmail input[type="submit"] {
        grid-column: 1;
    }
}