/* Pagorea Civilization Styling */

/* Text brightness breathing animation */
@keyframes textBrightnessBreath {
    0% {
        filter: brightness(0.9);
    }
    50% {
        filter: brightness(1.4);
    }
    100% {
        filter: brightness(0.9);
    }
}

.pagorea-body {
    background: linear-gradient(135deg, #1a2a3a 0%, #0f1820 50%, #1a2a3a 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

.pagorea-body::before {
    animation: breathing 6s ease-in-out infinite;
}

/* Pagorea Theme Colors */
.pagorea-body .navbar {
    background: rgba(15, 22, 25, 0.95);
    border-bottom-color: #d4af37;
}

.pagorea-body footer {
    background: rgba(15, 22, 25, 0.98);
    border-top-color: #d4af37;
}

.pagorea-body footer a {
    color: #d4af37;
}

.pagorea-body footer a:hover {
    color: #f5c547;
}

@keyframes snowfall {
    0% {
        top: 0;
        opacity: 1;
        transform: translateX(0) rotateZ(0deg);
    }
    50% {
        transform: translateX(var(--drift)) rotateZ(180deg);
        opacity: 1;
    }
    80% {
        top: 200vh;
        opacity: 1;
        transform: translateX(0) rotateZ(288deg);
    }
    100% {
        top: 250vh;
        opacity: 0;
        transform: translateX(0) rotateZ(360deg);
    }
}

#snowflake-container {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    display: contents !important;
}

.snowflake {
    position: fixed;
    width: 40px;
    height: 40px;
    font-size: 30px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
    z-index: 0;
    margin: 0;
    padding: 0;
    will-change: transform;
    animation: snowfall 12s linear forwards;
}

/* Pagorea Header */
.pagorea-header {
    position: relative;
    overflow: hidden;
}

.pagorea-header .container {
    max-width: 55%;
    margin-left: 0;
    text-align: left;
}

.pagorea-header h1 {
    color: #7fb8d4;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8), 0 0 10px rgba(127, 184, 212, 0.6), 0 0 20px rgba(127, 184, 212, 0.4), 0 0 30px rgba(127, 184, 212, 0.2);
}

.pagorea-header p {
    color: #9fdbf5;
}

/* Intro Section */
.pagorea-intro {
    background: #0f1619;
    background-image:
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence baseFrequency="0.9" numOctaves="4" result="noise" seed="2" /></filter><rect width="100" height="100" fill="%230f1619" filter="url(%23noise)" opacity="0.08"/></svg>');
    border-bottom: 2px solid rgba(127, 184, 212, 0.3);
}

.pagorea-intro .container {
    max-width: 55%;
    margin-left: 0;
    text-align: left;
}

.pagorea-intro h2 {
    color: #7fb8d4;
}

.pagorea-intro p {
    color: #d4e8f5;
}

/* Features Section */
.pagorea-features {
    background: #0f1619;
    background-image:
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence baseFrequency="0.9" numOctaves="4" result="noise" seed="2" /></filter><rect width="100" height="100" fill="%230f1619" filter="url(%23noise)" opacity="0.08"/></svg>');
    border-top: 2px solid rgba(74, 144, 164, 0.3);
    border-bottom: 2px solid rgba(74, 144, 164, 0.3);
}

/* Staggered Image Layout */
.staggered-image-left,
.staggered-image-right {
    width: 100%;
    padding: 3rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    background: transparent;
}

.staggered-image-left {
    justify-content: flex-start;
}

.staggered-image-left img {
    width: 45%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.staggered-image-left img:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

.staggered-image-right {
    justify-content: flex-end;
}

.staggered-image-right img {
    width: 45%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.staggered-image-right img:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

.image-text {
    flex: 1;
    padding: 1rem;
    text-align: center;
}

.image-text h3 {
    color: #7fb8d4;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(127, 184, 212, 0.5), 0 0 20px rgba(127, 184, 212, 0.3);
    animation: textBrightnessBreath 6s ease-in-out infinite;
}

.image-text p {
    color: #d0d0d0;
    font-size: 1.1rem;
    line-height: 1.6;
}

.pagorea-features h2 {
    color: #7fb8d4;
}

.pagorea-features .feature-box {
    background: linear-gradient(135deg, rgba(74, 144, 164, 0.15) 0%, rgba(26, 42, 58, 0.8) 100%);
    border-left: 4px solid #7fb8d4;
    border-radius: 4px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.pagorea-features .feature-box:hover {
    background: linear-gradient(135deg, rgba(74, 144, 164, 0.25) 0%, rgba(26, 42, 58, 0.9) 100%);
    box-shadow: 0 8px 20px rgba(74, 144, 164, 0.2);
    transform: translateY(-3px);
}

.pagorea-features .feature-box h3 {
    color: #9fdbf5;
}

.pagorea-features .feature-box p {
    color: #d4e8f5;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* Magic Section */
.pagorea-magic {
    background: #0f1619;
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
}

.pagorea-magic h2 {
    color: #7fb8d4;
    text-align: center;
    margin-bottom: 1rem;
}

.pagorea-magic > .container > p {
    text-align: center;
    color: #d4e8f5;
    margin-bottom: 2rem;
}

.magic-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.magic-spell {
    background: rgba(74, 144, 164, 0.1);
    border: 2px solid rgba(74, 144, 164, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.magic-spell:hover {
    background: rgba(74, 144, 164, 0.2);
    border-color: #7fb8d4;
    box-shadow: 0 4px 15px rgba(74, 144, 164, 0.2);
}

.magic-spell h3 {
    color: #9fdbf5;
    margin-bottom: 0.5rem;
}

.magic-spell p {
    color: #d4e8f5;
    font-size: 0.95rem;
}

/* Territory Section */
.pagorea-territory {
    background: #0f1619;
    background-image:
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence baseFrequency="0.9" numOctaves="4" result="noise" seed="2" /></filter><rect width="100" height="100" fill="%230f1619" filter="url(%23noise)" opacity="0.08"/></svg>');
    border-top: 2px solid rgba(74, 144, 164, 0.3);
    border-bottom: 2px solid rgba(74, 144, 164, 0.3);
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
}

.pagorea-territory h2 {
    color: #7fb8d4;
    text-align: center;
    margin-bottom: 1rem;
}

.pagorea-territory > .container > p {
    text-align: center;
    color: #d4e8f5;
    max-width: 800px;
    margin: 0 auto 2rem;
}

.territory-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.territory-item {
    background: rgba(74, 144, 164, 0.08);
    border: 1px solid rgba(74, 144, 164, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.territory-item:hover {
    background: rgba(74, 144, 164, 0.15);
    border-color: #7fb8d4;
}

.territory-item h3 {
    color: #9fdbf5;
    margin-bottom: 0.5rem;
}

.territory-item p {
    color: #d4e8f5;
    font-size: 0.95rem;
}

/* Roles Section */
.pagorea-roles {
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.6) 100%);
}

.pagorea-roles h2 {
    color: #7fb8d4;
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(127, 184, 212, 0.5), 0 0 20px rgba(127, 184, 212, 0.3);
    animation: textBrightnessBreath 6s ease-in-out infinite;
}

.pagorea-roles > .container > p {
    text-align: center;
    color: #d4e8f5;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.role {
    background: rgba(74, 144, 164, 0.1);
    border: 2px solid rgba(74, 144, 164, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.role:hover {
    background: rgba(74, 144, 164, 0.2);
    border-color: #7fb8d4;
    box-shadow: 0 6px 20px rgba(74, 144, 164, 0.2);
}

.role h3 {
    color: #9fdbf5;
    margin-bottom: 0.5rem;
}

.role p {
    color: #d4e8f5;
    font-size: 0.95rem;
}

.cta-section {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(74, 144, 164, 0.3);
}

.cta-section .cta-button {
    background: linear-gradient(135deg, #7fb8d4 0%, #4a90a4 100%);
    border-color: #7fb8d4;
    color: #fff;
}

.cta-section .cta-button:hover {
    background: linear-gradient(135deg, #9fdbf5 0%, #7fb8d4 100%);
    box-shadow: 0 6px 20px rgba(74, 144, 164, 0.4);
}

@media (max-width: 768px) {
    .pagorea-header h1 {
        font-size: 2.5rem;
    }

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

    .magic-types {
        grid-template-columns: 1fr;
    }

    .territory-list {
        grid-template-columns: 1fr;
    }

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

/* Flip Card Animation */
@keyframes flipCard {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(180deg);
    }
}

.flip-card {
    perspective: 1000px;
    margin: 1rem auto 0;
    cursor: pointer;
    display: inline-block;
}

.flip-card-inner {
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateX(180deg);
}

.flip-card-front, .flip-card-back {
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flip-card-front {
    color: #000;
    padding: 1rem 5rem;
    background: linear-gradient(135deg, #7fb8d4 0%, #4a7d9f 100%);
    border: 2px solid #7fb8d4;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(127, 184, 212, 0.3);
    font-weight: bold;
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
}

.flip-card-back {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 30%),
                linear-gradient(225deg, rgba(255, 255, 255, 0.1) 0%, transparent 40%),
                linear-gradient(135deg, #0f1619 0%, #070d10 20%, #020608 50%, #070d10 80%, #0f1619 100%);
    color: #7fb8d4;
    transform: rotateX(180deg);
    padding: 1rem 5rem;
    border: 2px solid rgba(127, 184, 212, 0.5);
    border-radius: 4px;
    font-weight: bold;
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 1px;

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