/* ===== AI POEM GENERATOR CSS ===== */

/* Layout */
.poem-wrapper { margin-bottom: 28px; }
.poem-grid    { display: grid; grid-template-columns: 1fr 1.15fr; gap: 20px; }

/* Cards */
.poem-input-card,
.poem-output-card {
    background: #fff; border: 2px solid #e5e7eb;
    border-radius: 20px; padding: 24px;
}
.poem-output-card { border-color: #fbcfe8; }
.poem-card-title  { font-size: 16px; font-weight: 800; color: #1f2937; margin-bottom: 18px; }

/* Fields */
.poem-field { margin-bottom: 16px; }
.poem-label { display: block; font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 7px; }
.poem-opt   { color: #9ca3af; font-weight: 400; font-size: 11px; }
.poem-hint  { font-size: 11px; color: #9ca3af; margin-top: 3px; }
.poem-char-count { font-size: 11px; color: #9ca3af; text-align: right; margin-top: 3px; }

/* Inputs */
.poem-input {
    width: 100%; border: 2px solid #e5e7eb; border-radius: 10px;
    padding: 10px 14px; font-size: 14px; outline: none; font-family: inherit;
    transition: border-color 0.2s; box-sizing: border-box; color: #1f2937;
}
.poem-input:focus { border-color: #ec4899; }

.poem-textarea {
    width: 100%; min-height: 90px; border: 2px solid #e5e7eb; border-radius: 12px;
    padding: 11px 14px; font-size: 14px; font-family: inherit; resize: vertical;
    outline: none; transition: border-color 0.2s; box-sizing: border-box;
    color: #1f2937; line-height: 1.6;
}
.poem-textarea:focus { border-color: #ec4899; }

/* ===== OCCASION GRID ===== */
.poem-occasion-grid {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
}
.occ-btn {
    background: #fdf2f8; border: 2px solid #fbcfe8; border-radius: 9px;
    padding: 8px 4px; cursor: pointer; transition: all 0.2s;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 16px;
}
.occ-btn span { font-size: 9px; font-weight: 700; color: #9d174d; line-height: 1.3; text-align: center; }
.occ-btn:hover { border-color: #ec4899; transform: translateY(-2px); background: #fce7f3; }
.occ-btn.active {
    background: linear-gradient(135deg, #ec4899, #db2777);
    border-color: #db2777;
}
.occ-btn.active span { color: #fff; }

/* ===== STYLE GRID ===== */
.poem-style-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px;
}
.style-btn {
    background: #fdf2f8; border: 2px solid #fbcfe8; border-radius: 10px;
    padding: 9px 5px; cursor: pointer; transition: all 0.2s;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 17px;
}
.style-btn span { font-size: 9px; font-weight: 700; color: #9d174d; text-align: center; line-height: 1.2; }
.style-btn:hover { border-color: #ec4899; transform: translateY(-2px); }
.style-btn.active {
    background: linear-gradient(135deg, #ec4899, #db2777);
    border-color: #db2777;
}
.style-btn.active span { color: #fff; }

/* Length + Lang Row */
.poem-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.poem-length-group { display: flex; flex-direction: column; gap: 5px; }
.plength-btn {
    background: #fdf2f8; border: 2px solid #fbcfe8; border-radius: 8px;
    padding: 8px 10px; font-size: 12px; font-weight: 700; color: #9d174d;
    cursor: pointer; transition: all 0.2s;
    display: flex; justify-content: space-between; align-items: center;
}
.plength-btn small { font-size: 10px; color: #f9a8d4; font-weight: 400; }
.plength-btn:hover { border-color: #ec4899; }
.plength-btn.active {
    background: linear-gradient(135deg, #ec4899, #db2777);
    border-color: #db2777; color: #fff;
}
.plength-btn.active small { color: #fce7f3; }

.poem-lang-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.poem-lang-btn {
    background: #fdf2f8; border: 2px solid #fbcfe8; border-radius: 7px;
    padding: 6px 8px; font-size: 11px; font-weight: 700; color: #9d174d;
    cursor: pointer; transition: all 0.2s; text-align: center;
}
.poem-lang-btn:hover { border-color: #ec4899; }
.poem-lang-btn.active {
    background: linear-gradient(135deg, #ec4899, #db2777);
    border-color: #db2777; color: #fff;
}

/* Generate Button */
.poem-generate-btn {
    width: 100%; background: linear-gradient(135deg, #ec4899, #db2777);
    color: #fff; border: none; border-radius: 14px; padding: 15px;
    font-size: 17px; font-weight: 800; cursor: pointer; transition: all 0.25s;
    box-shadow: 0 4px 16px rgba(236,72,153,0.35); margin-top: 4px;
}
.poem-generate-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(236,72,153,0.45); }
.poem-generate-btn:disabled { opacity: 0.7; cursor: not-allowed; }

/* ===== PLACEHOLDER ===== */
.poem-placeholder {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: 420px; gap: 12px; text-align: center; position: relative;
}
.pp-bg { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; overflow: hidden; border-radius: 16px; }
.pp-petal {
    position: absolute; font-size: 32px; opacity: 0.15;
    animation: pp-float 4s ease-in-out infinite;
}
.pp-petal:nth-child(1) { top: 10%; left: 10%; }
.pp-petal:nth-child(2) { top: 60%; right: 10%; animation-delay: 1.3s; }
.pp-petal:nth-child(3) { bottom: 15%; left: 40%; animation-delay: 2.5s; }
@keyframes pp-float { 0%,100%{transform:translateY(0) rotate(0)} 50%{transform:translateY(-14px) rotate(15deg)} }

.pp-title { font-size: 16px; font-weight: 800; color: #374151; position: relative; z-index: 1; }
.pp-sub   { font-size: 13px; color: #9ca3af; position: relative; z-index: 1; margin-bottom: 8px; }
.pp-examples { display: flex; flex-direction: column; gap: 7px; width: 100%; max-width: 310px; position: relative; z-index: 1; }
.pp-ex {
    background: #fdf2f8; border: 1.5px solid #fbcfe8; border-radius: 10px;
    padding: 8px 14px; font-size: 12px; color: #9d174d; text-align: left;
}

/* Loading */
.poem-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 420px; gap: 14px; }
.poem-loader  { margin-bottom: 4px; }
.loader-feather {
    font-size: 50px;
    animation: feather-write 1.2s ease-in-out infinite alternate;
    display: inline-block;
}
@keyframes feather-write {
    from { transform: translateX(-8px) rotate(-20deg); }
    to   { transform: translateX(8px) rotate(20deg); }
}
.poem-loading-title { font-size: 16px; font-weight: 800; color: #374151; }
.poem-loading-steps { display: flex; flex-direction: column; gap: 7px; width: 100%; max-width: 270px; }
.poem-lstep { font-size: 12px; color: #9ca3af; padding: 6px 14px; border-radius: 20px; transition: all 0.4s; }
.poem-lstep.active { color: #9d174d; background: #fce7f3; font-weight: 600; }

/* Result Header */
.poem-result-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
    margin-bottom: 12px; padding-bottom: 12px; border-bottom: 2px solid #fce7f3;
}
.poem-title-section { flex: 1; }
.poem-title-label { font-size: 10px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.poem-title-text  { font-size: 18px; font-weight: 900; color: #1f2937; line-height: 1.3; font-style: italic; }
.poem-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.poem-badge {
    font-size: 10px; font-weight: 700; padding: 2px 8px;
    border-radius: 10px; background: #fdf2f8; color: #9d174d;
    border: 1px solid #fbcfe8;
}
.poem-header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.poem-line-badge {
    font-size: 11px; font-weight: 700; padding: 3px 9px;
    background: #fdf2f8; color: #9d174d; border-radius: 20px; border: 1.5px solid #fbcfe8;
}
.poem-regen-btn {
    background: linear-gradient(135deg,#ec4899,#db2777); color: #fff;
    border: none; border-radius: 8px; padding: 6px 12px;
    font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.poem-regen-btn:hover { transform: translateY(-1px); }

/* ===== AUDIO BAR ===== */
.poem-audio-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: linear-gradient(135deg, #500724, #831843);
    border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; flex-wrap: wrap;
}
.poem-audio-left  { display: flex; align-items: center; gap: 10px; }
.poem-play-btn {
    width: 42px; height: 42px; border-radius: 50%;
    background: linear-gradient(135deg, #ec4899, #db2777);
    border: none; color: #fff; font-size: 16px; font-weight: 900;
    cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.poem-play-btn:hover { transform: scale(1.1); box-shadow: 0 0 14px rgba(236,72,153,0.6); }
.poem-play-btn.playing { background: linear-gradient(135deg,#059669,#10b981); animation: poem-pulse 1.5s infinite; }
@keyframes poem-pulse { 0%{box-shadow:0 0 0 0 rgba(16,185,129,0.5)} 70%{box-shadow:0 0 0 8px rgba(16,185,129,0)} 100%{box-shadow:0 0 0 0 rgba(16,185,129,0)} }
.poem-audio-info   { display: flex; flex-direction: column; gap: 1px; }
.poem-audio-label  { font-size: 12px; font-weight: 700; color: #fce7f3; }
.poem-audio-status { font-size: 10px; color: #f9a8d4; }

.poem-audio-right  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.poem-speed-group  { display: flex; gap: 4px; }
.poem-speed-btn {
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px; padding: 4px 8px; font-size: 11px; font-weight: 700;
    color: #fce7f3; cursor: pointer; transition: all 0.2s;
}
.poem-speed-btn:hover { background: rgba(255,255,255,0.2); }
.poem-speed-btn.active { background: #ec4899; border-color: #ec4899; color: #fff; }

.poem-ambient-btn {
    background: rgba(255,255,255,0.08); border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 8px; padding: 5px 10px; font-size: 11px; font-weight: 700;
    color: #fce7f3; cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.poem-ambient-btn:hover { background: rgba(255,255,255,0.15); }
.poem-ambient-btn.on { background: rgba(16,185,129,0.2); border-color: #10b981; color: #6ee7b7; }

/* ===== POEM DISPLAY CARD ===== */
.poem-display-card {
    background: linear-gradient(135deg, #fff0f6, #fdf2f8, #fff0f6);
    border: 2px solid #fbcfe8; border-radius: 16px;
    padding: 28px 32px; margin-bottom: 14px; position: relative;
    overflow: hidden;
}
.poem-display-card::before {
    content: '"'; position: absolute; top: -10px; left: 12px;
    font-size: 100px; color: rgba(236,72,153,0.08); font-family: Georgia, serif;
    line-height: 1;
}
.poem-display-card::after {
    content: '"'; position: absolute; bottom: -30px; right: 12px;
    font-size: 100px; color: rgba(236,72,153,0.08); font-family: Georgia, serif;
    line-height: 1;
}

.poem-body-text {
    font-size: 15px; line-height: 2.1; color: #1f2937;
    white-space: pre-wrap; text-align: center;
    font-family: Georgia, 'Times New Roman', serif;
    position: relative; z-index: 1;
    max-height: 400px; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: #fbcfe8 transparent;
}
.poem-body-text::-webkit-scrollbar { width: 4px; }
.poem-body-text::-webkit-scrollbar-thumb { background: #fbcfe8; border-radius: 3px; }

/* Footer Actions */
.poem-footer-actions { display: flex; gap: 7px; margin-bottom: 14px; }
.poem-copy-btn,
.poem-whatsapp-btn,
.poem-download-btn,
.poem-card-btn {
    flex: 1; padding: 9px 6px; border-radius: 10px;
    font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.2s; border: 2px solid;
    text-align: center;
}
.poem-copy-btn      { background: linear-gradient(135deg,#ec4899,#db2777); color: #fff; border-color: #db2777; }
.poem-copy-btn:hover { transform: translateY(-2px); }
.poem-whatsapp-btn  { background: #25d366; border-color: #25d366; color: #fff; }
.poem-whatsapp-btn:hover { background: #22c55e; }
.poem-download-btn  { background: #fff; border-color: #fbcfe8; color: #9d174d; }
.poem-download-btn:hover { background: #fdf2f8; border-color: #ec4899; }
.poem-card-btn      { background: linear-gradient(135deg,#7c3aed,#a855f7); color: #fff; border-color: #a855f7; }
.poem-card-btn:hover { transform: translateY(-2px); }

/* Poem Card Preview */
.poem-card-preview {
    text-align: center; margin-top: 6px;
}
.poem-card-preview canvas {
    width: 100%; max-width: 600px; border-radius: 12px;
    box-shadow: 0 8px 24px rgba(236,72,153,0.2);
    border: 2px solid #fbcfe8;
}
.poem-download-card-btn {
    margin-top: 10px; background: linear-gradient(135deg,#ec4899,#db2777);
    color: #fff; border: none; border-radius: 10px; padding: 10px 24px;
    font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.2s;
    display: inline-block;
}
.poem-download-card-btn:hover { transform: translateY(-2px); }

/* Error */
.poem-error { display: flex; align-items: center; gap: 8px; padding: 18px; background: #fff5f5; border-radius: 12px; color: #dc2626; font-size: 14px; min-height: 70px; }

/* Info Box */
.info-box { background: linear-gradient(135deg,#fdf2f8,#fce7f3); border-radius: 16px; padding: 26px; margin-bottom: 24px; border: 2px solid rgba(236,72,153,0.15); }
.info-box h4 { color: #831843; font-size: 20px; margin-bottom: 16px; }
.info-grid   { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 12px; }
.info-item   { background: #fff; border-radius: 12px; padding: 14px; font-size: 13px; color: #374151; line-height: 1.6; border: 2px solid rgba(236,72,153,0.1); }
.info-item strong { display: block; color: #ec4899; font-size: 13px; font-weight: 700; margin-bottom: 3px; }

/* SEO */
.seo-content { padding: 70px 20px; background: #fff; }
.content-article { max-width: 900px; margin: 0 auto; line-height: 1.8; }
.content-article h2 { font-size: 26px; font-weight: 800; margin-top: 32px; margin-bottom: 14px; color: #333; }
.content-article h2:first-child { margin-top: 0; }
.content-article h3 { font-size: 19px; font-weight: 700; margin-top: 22px; margin-bottom: 10px; color: #444; }
.content-article p  { margin-bottom: 14px; color: #666; font-size: 16px; }
.content-article strong { color: #333; font-weight: 700; }

/* Responsive */
@media (max-width: 960px) { .poem-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
    .poem-occasion-grid { grid-template-columns: repeat(6, 1fr); }
    .poem-style-grid    { grid-template-columns: repeat(5, 1fr); }
    .poem-row-2         { grid-template-columns: 1fr; }
    .poem-length-group  { flex-direction: row; }
    .plength-btn        { flex: 1; }
    .poem-footer-actions { flex-wrap: wrap; }
    .poem-copy-btn, .poem-whatsapp-btn, .poem-download-btn, .poem-card-btn { flex: calc(50% - 4px); }
    .poem-audio-right   { width: 100%; }
    .poem-display-card  { padding: 18px 16px; }
}
@media (max-width: 480px) {
    .poem-input-card, .poem-output-card { padding: 14px; }
    .poem-occasion-grid { grid-template-columns: repeat(6, 1fr); }
    .poem-style-grid    { grid-template-columns: repeat(5, 1fr); }
    .poem-lang-grid     { grid-template-columns: repeat(2, 1fr); }
}
