/* Affinity Style Design */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,700&family=Inter:wght@400;500;600&display=swap');

body.affinity-theme {
    background-color: #000000;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
}

.affinity-theme .navbar {
    background-color: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.affinity-theme .navbar-brand,
.affinity-theme .nav-link,
.affinity-theme .btn-outline-warning {
    color: #ffffff !important;
}

.affinity-theme .navbar-brand .brand-text {
    color: #ffffff !important;
}

.affinity-theme .nav-link {
    color: #ffffff !important;
    transition: color 0.3s ease;
}

.affinity-theme .nav-link:hover,
.affinity-theme .nav-link.active {
    color: #a3e635 !important;
}

.affinity-theme .btn-outline-warning {
    color: #ffffff !important;
    border-color: #a3e635 !important;
}

.affinity-theme .btn-outline-warning:hover {
    background-color: #a3e635 !important;
    color: #000000 !important;
}

.affinity-hero-section {
    padding-top: 40px;
}

.affinity-hero {
    text-align: center;
    padding: 80px 20px 120px;
}

.affinity-hero h1 {
    font-family: 'Fraunces', serif;
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -1px;
    color: #ffffff;
}

.affinity-hero p {
    font-size: 1.2rem;
    color: #a0a0a0;
    max-width: 800px;
    margin: 0 auto 60px;
    line-height: 1.6;
}

.affinity-cards {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 0 20px 80px;
    flex-wrap: wrap;
    perspective: 1000px;
    /* Enable 3D perspective */
}

/* Card Flip Styles */
.affinity-card-container {
    width: 100%;
    max-width: 600px;
    height: 500px;
    /* Fixed height for flip effect */
    position: relative;
    margin-bottom: 30px;
    /* Add spacing for mobile stack */
}

.affinity-card {
    background-color: #111;
    border-radius: 24px;
    width: 100%;
    height: 100%;
    position: relative;
    border: 1px solid #222;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    display: flex;
    flex-direction: column;
}

.affinity-card.flipped {
    transform: rotateY(180deg);
}

.affinity-card-front,
.affinity-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 24px;
    overflow: hidden;
}

.affinity-card-front {
    background-color: #111;
    /* Ensure front has a background */
    display: flex;
    flex-direction: column;
    z-index: 2;
    transform: rotateY(0deg);
    /* Explicitly set rotation */
}

.affinity-card-back {
    background-color: #1a1a1a;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    padding: 40px;
    border: 1px solid #333;
    z-index: 1;
    /* Ensure back is behind initially */
}

/* Back Content Styles */
.affinity-card-back-title {
    font-family: 'Fraunces', serif;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 20px;
}

.affinity-card-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center list items vertically */
}

.affinity-card-list li {
    margin-bottom: 12px;
}

.affinity-card-list a {
    color: #ccc;
    text-decoration: none;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.2s;
    background-color: rgba(255, 255, 255, 0.05);
}

.affinity-card-list a:hover {
    background-color: #a3e635;
    color: #000;
    transform: translateX(5px);
}

.affinity-card-list a i {
    margin-right: 15px;
    width: 24px;
    text-align: center;
    font-size: 1.2rem;
}

/* Close Button on Back */
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    z-index: 10;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Existing Styles with Modifications */
.affinity-card:hover {
    /* Removed transform on hover to avoid conflict with flip */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: #333;
}

.affinity-card-content {
    padding: 40px;
    z-index: 2;
    position: relative;
    flex-grow: 1;
    /* Ensure content takes space */
}

.affinity-card-subtitle {
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    margin-bottom: 10px;
    display: block;
}

.affinity-card-title {
    font-family: 'Fraunces', serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1;
    color: #ffffff;
}

.affinity-card-desc {
    color: #888;
    margin-bottom: 30px;
    font-size: 1rem;
    line-height: 1.5;
}

.affinity-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background-color: #a3e635;
    /* Lime green like the image */
    color: #000;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.affinity-btn:hover {
    background-color: #84cc16;
    color: #000;
}

.affinity-btn i {
    margin-right: 8px;
}

.affinity-card-image {
    width: 100%;
    height: 100%;
    /* Cover full height */
    object-fit: cover;
    mask-image: linear-gradient(to bottom, transparent 0%, black 60%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 60%);
    opacity: 0.5;
    transition: opacity 0.3s;
    position: absolute;
    /* Changed to absolute to fit in front face */
    bottom: 0;
    left: 0;
    z-index: 1;
}

.affinity-card:hover .affinity-card-image {
    opacity: 0.8;
}

.plus-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 60px;
    /* Increased size */
    height: 60px;
    /* Increased size */
    border-radius: 50%;
    background-color: transparent;
    /* Transparent background */
    background-image: url('../img/uptime-kuma.svg');
    /* Use uptime-kuma.svg */
    background-size: cover;
    background-position: center;
    color: #fff;
    /* White plus icon */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    /* Increased font size for plus */
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    /* Remove border */
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    /* Add shadow */
}

.plus-btn:hover {
    transform: scale(1.1) rotate(90deg);
    /* Rotate and scale on hover */
    filter: brightness(1.2);
    /* Brighten on hover */
    color: #fff;
    /* Keep plus color white on hover */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .affinity-hero h1 {
        font-size: 2.5rem;
    }

    .affinity-card-title {
        font-size: 2rem;
    }

    .affinity-cards {
        flex-direction: column;
        align-items: center;
    }

    .affinity-card-container {
        height: 600px;
        /* Increased height for mobile */
        max-width: 100%;
        /* Full width on mobile */
    }

    .affinity-card-content {
        padding: 30px;
    }
}

/* Footer overrides for Affinity Theme */
.affinity-theme footer hr {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.affinity-theme footer p.text-muted,
.affinity-theme footer a.link-secondary span {
    color: rgba(255, 255, 255, 0.5) !important;
}

.affinity-theme footer a.link-secondary:hover span {
    color: #ffffff !important;
}

/* Promo Banner Style (Lavender) */
.affinity-promo-banner {
    background-color: #e0ccff;
    border-radius: 32px;
    padding: 60px 80px;
    position: relative;
    overflow: hidden;
    color: #000;
    margin: 80px 0;
    display: flex;
    align-items: center;
    min-height: 400px;
    z-index: 1;
}

.affinity-promo-content {
    position: relative;
    z-index: 2;
    max-width: 550px;
}

.affinity-promo-title {
    font-family: 'Fraunces', serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.1;
    color: #000;
}

.affinity-promo-desc {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 30px;
    font-weight: 500;
}

.affinity-promo-img-container {
    position: absolute;
    right: 20px;
    top: 0;
    bottom: 0;
    width: 45%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}

.affinity-promo-img-container img {
    max-width: 100%;
    max-height: 90%;
    object-fit: contain;
    transform: none;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
}

@media (max-width: 992px) {
    .affinity-promo-banner {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px;
        overflow: hidden;
    }

    .affinity-promo-content {
        max-width: 100%;
        margin-bottom: 40px;
    }

    .affinity-promo-img-container {
        position: relative;
        right: auto;
        bottom: auto;
        width: 100%;
        height: 300px;
        transform: none;
    }

    .affinity-promo-img-container img {
        transform: none;
        max-height: 100%;
    }
}

/* Affinity Dropdown Styles (Image Match) */
.affinity-card .dropdown-menu {
    background-color: #000000;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 8px;
    min-width: 240px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    margin-top: 10px !important;
}

.affinity-card .dropdown-item {
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
}

.affinity-card .dropdown-item:hover,
.affinity-card .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.affinity-card .dropdown-divider {
    border-top-color: rgba(255, 255, 255, 0.15);
    margin: 8px 0;
}

.affinity-card .dropdown-toggle::after {
    margin-left: 0.5em;
    vertical-align: middle;
}