/* Armenian Language Learning — Gradient Shapes */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #fafaf8;
    --bg-card: #fff;
    --text: #1a1a1a;
    --text-secondary: #666;
    --border: rgba(0,0,0,0.06);
    --border-medium: rgba(0,0,0,0.08);
    --nav-hover: rgba(0,0,0,0.05);
    --card-overlay: rgba(255,255,255,0.7);
    --btn-bg: #1a1a1a;
    --btn-text: #fff;
    --radius: 20px;
    --radius-sm: 12px;

    /* Pastel card backgrounds */
    --card-peach: #fde8dc;
    --card-gray: #eaeaea;
    --card-lavender: #ebe6f5;
    --card-green: #dceee8;

    /* Primary accent */
    --primary: #E85A4F;
}

[data-theme="dark"] {
    --bg: #17171c;
    --bg-card: #222228;
    --text: #e8e6e3;
    --text-secondary: #8e8e93;
    --border: rgba(255,255,255,0.08);
    --border-medium: rgba(255,255,255,0.1);
    --nav-hover: rgba(255,255,255,0.08);
    --card-overlay: rgba(0,0,0,0.3);
    --btn-bg: #e8e6e3;
    --btn-text: #17171c;

    --card-peach: #2b2220;
    --card-gray: #262626;
    --card-lavender: #252235;
    --card-green: #1d2924;

    --primary: #ff7b72;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.site-header {
    padding: 16px 0;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-am {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-ru {
    font-size: 12px;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-nav {
    display: flex;
    gap: 6px;
}

.main-nav a {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 50px;
    color: var(--text);
}

.main-nav a:hover {
    background: var(--nav-hover);
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-medium);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--nav-hover);
    color: var(--text);
}

.theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: block;
}

/* Main */
main {
    flex: 1;
    padding: 40px 0;
}

/* Hero */
.hero {
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 8px;
}

.hero-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 400px;
}

/* Breadcrumbs */
.breadcrumbs ol {
    list-style: none;
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--text-secondary);
}

.breadcrumbs li:not(:last-child)::after {
    content: '/';
    margin-left: 8px;
    opacity: 0.4;
}

.breadcrumbs a:hover {
    color: var(--text);
}

/* Phrase Card Main */
.phrase-card {
    background: var(--card-peach);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.phrase-card::after {
    content: '';
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, #f4a574 0%, #e8927a 50%, #d4805a 100%);
    border-radius: 24px;
    transform: translateY(-50%) rotate(15deg);
    opacity: 0.6;
}

.phrase-card h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.phrase-content {
    position: relative;
    z-index: 1;
}

.phrase-content > div {
    margin-bottom: 12px;
    padding: 14px 16px;
    background: var(--card-overlay);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(4px);
}

.phrase-content .label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.phrase-armenian .text-am {
    font-size: 17px;
    font-weight: 600;
}

.phrase-russian .text-ru {
    font-size: 17px;
    font-weight: 600;
}

.phrase-transcription .transcription {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.phrase-transliteration .transliteration {
    font-size: 14px;
    font-family: 'SF Mono', monospace;
}

.phrase-category {
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--card-overlay);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(4px);
    position: relative;
    z-index: 1;
}

.phrase-category .label {
    display: inline;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    margin-right: 8px;
}

.phrase-category a {
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid currentColor;
}

.phrase-category a:hover {
    opacity: 0.7;
}

/* Audio Player */
.audio-player {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--btn-bg);
    color: var(--btn-text);
    padding: 10px 20px;
    border-radius: 50px;
    margin-top: 16px;
    cursor: pointer;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.audio-player:hover {
    opacity: 0.9;
}

.play-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    display: flex;
    width: 22px;
    height: 22px;
}

.play-text {
    font-weight: 500;
}

/* Phrase Grid */
.phrase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.phrase-card-mini {
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    min-height: 140px;
}

/* Peach/Orange gradient card */
.phrase-card-mini:nth-child(4n+1) {
    background: var(--card-peach);
}
.phrase-card-mini:nth-child(4n+1)::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #f4a574 0%, #e8927a 50%, #d4805a 100%);
    border-radius: 20px;
    transform: rotate(15deg);
    opacity: 0.7;
}

/* Gray gradient card */
.phrase-card-mini:nth-child(4n+2) {
    background: var(--card-gray);
}
.phrase-card-mini:nth-child(4n+2)::after {
    content: '';
    position: absolute;
    right: -10px;
    bottom: -10px;
    width: 90px;
    height: 90px;
    background: radial-gradient(circle at 30% 30%, #b8b8b8 0%, #888 100%);
    border-radius: 50%;
    opacity: 0.5;
}
.phrase-card-mini:nth-child(4n+2)::before {
    content: '';
    position: absolute;
    right: 30px;
    bottom: 20px;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at 30% 30%, #a0a0a0 0%, #707070 100%);
    border-radius: 50%;
    opacity: 0.4;
}

/* Lavender/Purple gradient card */
.phrase-card-mini:nth-child(4n+3) {
    background: var(--card-lavender);
}
.phrase-card-mini:nth-child(4n+3)::after {
    content: '';
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 80px;
    height: 80px;
    background: conic-gradient(from 180deg, #d4c8eb 0%, #b8a8dc 25%, #c4b8e4 50%, #d8ceef 75%, #d4c8eb 100%);
    border-radius: 50%;
    opacity: 0.8;
}
.phrase-card-mini:nth-child(4n+3)::before {
    content: '';
    position: absolute;
    right: 30px;
    bottom: 30px;
    width: 50px;
    height: 50px;
    background: conic-gradient(from 0deg, #c8bce0 0%, #a898cc 50%, #c8bce0 100%);
    border-radius: 50%;
    opacity: 0.6;
}

/* Green/Teal gradient card */
.phrase-card-mini:nth-child(4n+4) {
    background: var(--card-green);
}
.phrase-card-mini:nth-child(4n+4)::after {
    content: '';
    position: absolute;
    right: -10px;
    bottom: -10px;
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #7ab5a0 0%, #5a9a84 100%);
    border-radius: 16px;
    opacity: 0.6;
}
.phrase-card-mini:nth-child(4n+4)::before {
    content: '';
    position: absolute;
    right: 50px;
    bottom: 40px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8ac4ae 0%, #6aa894 100%);
    border-radius: 8px;
    opacity: 0.5;
}

.phrase-card-mini:hover {
    opacity: 0.95;
}

.phrase-card-mini .text-ru {
    display: block;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 1;
}

.phrase-card-mini .transcription {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
    color: var(--text);
}

.phrase-card-mini .text-am {
    font-size: 13px;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.category-card {
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 100px;
}

.category-card:nth-child(4n+1) {
    background: var(--card-green);
}
.category-card:nth-child(4n+1)::after {
    content: '';
    position: absolute;
    right: -15px;
    bottom: -15px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #7ab5a0 0%, #5a9a84 100%);
    border-radius: 14px;
    opacity: 0.5;
}

.category-card:nth-child(4n+2) {
    background: var(--card-peach);
}
.category-card:nth-child(4n+2)::after {
    content: '';
    position: absolute;
    right: -10px;
    bottom: -10px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f4a574 0%, #d4805a 100%);
    border-radius: 16px;
    transform: rotate(10deg);
    opacity: 0.6;
}

.category-card:nth-child(4n+3) {
    background: var(--card-gray);
}
.category-card:nth-child(4n+3)::after {
    content: '';
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at 30% 30%, #a8a8a8 0%, #808080 100%);
    border-radius: 50%;
    opacity: 0.4;
}

.category-card:nth-child(4n+4) {
    background: var(--card-lavender);
}
.category-card:nth-child(4n+4)::after {
    content: '';
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 55px;
    height: 55px;
    background: conic-gradient(from 180deg, #c4b8e4 0%, #a898cc 50%, #c4b8e4 100%);
    border-radius: 50%;
    opacity: 0.6;
}

.category-card:hover {
    opacity: 0.95;
}

.category-name {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.category-count {
    font-size: 13px;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

/* Phrase List */
.phrase-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.phrase-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.phrase-list li:nth-child(4n+1) a { background: var(--card-green); }
.phrase-list li:nth-child(4n+2) a { background: var(--card-lavender); }
.phrase-list li:nth-child(4n+3) a { background: var(--card-peach); }
.phrase-list li:nth-child(4n+4) a { background: var(--card-gray); }

.phrase-list a:hover {
    opacity: 0.9;
}

.phrase-list .text-am {
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.phrase-list .text-ru {
    color: var(--text-secondary);
    font-size: 13px;
    position: relative;
    z-index: 1;
}

/* Sections */
.related-phrases,
.category-phrases,
.other-categories,
.categories,
.featured-phrases {
    margin-top: 40px;
}

.related-phrases h2,
.category-phrases h2,
.other-categories h2,
.categories h2,
.featured-phrases h2,
.about h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 18px;
    letter-spacing: -0.02em;
}

.see-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--text);
    padding-bottom: 2px;
}

.see-all:hover {
    opacity: 0.7;
}

.category-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-list a {
    display: inline-block;
    padding: 10px 18px;
    background: var(--bg-card);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border-medium);
}

.category-list a:hover {
    background: var(--btn-bg);
    color: var(--btn-text);
    border-color: var(--btn-bg);
}

/* About */
.about {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    margin-top: 40px;
    border: 1px solid var(--border);
}

.about p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Alphabet */
.alphabet-page h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.03em;
}

.alphabet-intro {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 500px;
}

.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 36px;
}

.letter-card {
    border-radius: var(--radius-sm);
    padding: 16px 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.letter-card:nth-child(4n+1) { background: var(--card-green); }
.letter-card:nth-child(4n+2) { background: var(--card-lavender); }
.letter-card:nth-child(4n+3) { background: var(--card-peach); }
.letter-card:nth-child(4n+4) { background: var(--card-gray); }

.letter-card:hover {
    opacity: 0.9;
}

.letter-armenian {
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.letter-upper {
    font-size: 28px;
    font-weight: 700;
    margin-right: 4px;
}

.letter-lower {
    font-size: 22px;
    opacity: 0.5;
}

.letter-name {
    display: block;
    font-size: 12px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.letter-sound {
    font-size: 12px;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

.alphabet-about {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    margin-top: 36px;
    border: 1px solid var(--border);
}

.alphabet-about h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
}

.alphabet-about p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.7;
}

.alphabet-about p:last-child {
    margin-bottom: 0;
}

/* Error */
.error-page {
    text-align: center;
    padding: 80px 0;
}

.error-page h1 {
    font-size: 72px;
    font-weight: 700;
    margin-bottom: 12px;
}

.error-page p {
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--btn-bg);
    color: var(--btn-text);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
}

.btn:hover {
    opacity: 0.9;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
    text-align: center;
    margin-top: auto;
}

.site-footer p {
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-tagline {
    margin-top: 4px;
}

.footer-version {
    margin-top: 14px;
    font-size: 11px;
    opacity: 0.4;
}

.footer-sitemap {
    margin-top: 6px;
    font-size: 10px;
    opacity: 0.35;
}

.footer-sitemap a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-sitemap a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
    .site-header .container {
        flex-direction: column;
        gap: 12px;
        position: relative;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .main-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .theme-toggle {
        position: absolute;
        top: 0;
        right: 24px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .phrase-grid {
        grid-template-columns: 1fr;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .alphabet-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .phrase-list a {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .phrase-card::after {
        width: 120px;
        height: 120px;
        right: -40px;
    }
}

/* === МОЛИТВЫ === */

/* Prayer listing page */
.prayers-page .prayer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.prayer-card-link {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.prayer-card-link:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.prayer-title-ru {
    font-size: 18px;
    font-weight: 700;
}

.prayer-title-am {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Single prayer page */
.prayer-page .prayer-card {
    max-width: 800px;
}

.prayer-page .prayer-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-top: 24px;
}

.prayer-text-block {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.prayer-text-block h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.prayer-text-block .prayer-text {
    font-size: 17px;
    line-height: 1.8;
}

/* Transcription block — primary, larger */
.prayer-transcription {
    border-color: var(--primary);
    border-width: 2px;
}

.prayer-transcription .prayer-text {
    font-size: 20px;
    font-weight: 500;
}

/* Armenian text block */
.prayer-armenian .prayer-text {
    font-size: 18px;
}

/* Other prayers section */
.other-prayers {
    margin-top: 48px;
}

.other-prayers h2 {
    margin-bottom: 16px;
}

.other-prayers .prayer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Responsive prayers */
@media (max-width: 600px) {
    .prayer-text-block {
        padding: 16px;
    }

    .prayer-transcription .prayer-text {
        font-size: 17px;
    }

    .prayer-armenian .prayer-text {
        font-size: 16px;
    }
}

/* === DARK THEME: gradient shape overrides === */
[data-theme="dark"] .phrase-card::after {
    opacity: 0.3;
}

[data-theme="dark"] .phrase-card-mini::after {
    opacity: 0.25;
}

[data-theme="dark"] .phrase-card-mini::before {
    opacity: 0.2;
}

[data-theme="dark"] .category-card::after {
    opacity: 0.25;
}

[data-theme="dark"] .prayer-card-link:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
