/* ===== Modern Variables - Cyberpunk Theme ===== */
:root {
    --primary-color: #ff0844;
    --secondary-color: #ff6b9d;
    --accent-color: #c41e3a;
    --dark-bg: #1a1625;
    --card-bg: #2a2438;
    --text-light: #ffffff;
    --text-gray: #b8b8d1;
    --gradient-1: linear-gradient(135deg, #c41e3a 0%, #ff0844 100%);
    --gradient-2: linear-gradient(135deg, #ff0844 0%, #ff6b9d 100%);
    --gradient-3: linear-gradient(135deg, #8b1538 0%, #ff0844 100%);
    --gradient-primary: linear-gradient(135deg, #c41e3a 0%, #ff0844 100%);
    --shadow-sm: 0 2px 8px rgba(255, 8, 68, 0.1);
    --shadow-md: 0 4px 16px rgba(255, 8, 68, 0.2);
    --shadow-lg: 0 8px 32px rgba(255, 8, 68, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--dark-bg);
    font-family: 'Kanit', 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    overflow-x: hidden;
}

/* ===== Animated Background ===== */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #1a1625 0%, #2a2438 50%, #3a3050 100%);
}

.animated-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 8, 68, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(196, 30, 58, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 107, 157, 0.1) 0%, transparent 50%);
    animation: bgAnimation 15s ease infinite;
}

@keyframes bgAnimation {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ===== Loading Screen ===== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loader {
    text-align: center;
}

.loader-inner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 8, 68, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(255, 8, 68, 0.5);
}

.loader-text {
    color: var(--text-light);
    font-size: 16px;
    font-weight: 500;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Modern Navbar ===== */
#navbar {
    background: rgba(26, 31, 58, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    transition: var(--transition);
    box-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

#navbar.scrolled {
    padding: 10px 5%;
    box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-logo {
    height: 70px;
    width: auto;
    transition: var(--transition);
    filter: drop-shadow(0 0 10px rgba(255, 8, 68, 0.5));
}

.navbar-logo:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 20px rgba(255, 8, 68, 0.8));
}

.navbar-title {
    font-size: 22px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: var(--transition);
    z-index: -1;
}

.nav-link:hover::before {
    left: 0;
}

.nav-link:hover {
    color: white;
    transform: translateY(-2px);
}

.nav-link-line:hover {
    background: linear-gradient(135deg, #06C755 0%, #00B800 100%);
}

.nav-link-telegram:hover {
    background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    color: var(--primary-color);
}

/* ===== Hero Section ===== */
.hero-section {
    padding: 150px 5% 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 8, 68, 0.2);
    border: 2px solid var(--primary-color);
    padding: 8px 20px;
    border-radius: 50px;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 30px;
    animation: pulse 2s infinite;
    box-shadow: 0 0 20px rgba(255, 8, 68, 0.4);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(20deg); }
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-gray);
    margin-bottom: 50px;
    line-height: 1.8;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 10px;
}

.stat-label {
    color: var(--text-gray);
    font-size: 1rem;
    font-weight: 500;
}

/* ===== Container ===== */
.container {
    padding: 60px 5%;
    text-align: center;
    color: var(--text-light);
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== Section Header ===== */
.section-header {
    margin-bottom: 60px;
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.title-icon {
    font-size: 2.5rem;
}

.section-subtitle {
    color: var(--text-gray);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Template Grid ===== */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 0;
}

/* ===== Template Card ===== */
.template {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    position: relative;
    border: 1px solid rgba(255, 8, 68, 0.1);
}

.template:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px rgba(255, 8, 68, 0.4), 0 0 30px rgba(255, 8, 68, 0.2);
    border-color: var(--primary-color);
}

.template-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    z-index: 10;
    letter-spacing: 0.5px;
}

.new-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    animation: glow 2s ease-in-out infinite;
}

.popular-badge {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 8, 68, 0.6); }
    50% { box-shadow: 0 0 30px rgba(255, 8, 68, 0.9); }
}

.template-image {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 200px; /* Fixed height */
    background: linear-gradient(135deg, #2a2438 0%, #3a3050 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: var(--transition);
    display: block;
}

.template:hover .template-image img {
    transform: scale(1.1);
}

.template-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition);
}

.template-overlay i {
    font-size: 48px;
    color: white;
    transform: scale(0.5);
    transition: var(--transition);
}

.template:hover .template-overlay {
    opacity: 1;
}

.template:hover .template-overlay i {
    transform: scale(1);
}

.template-content {
    padding: 25px;
}

.template h3 {
    color: var(--text-light);
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.template-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.tag {
    background: rgba(255, 8, 68, 0.15);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255, 8, 68, 0.3);
}

/* ===== Buttons ===== */
.buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.button {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border-radius: 12px;
    transition: var(--transition);
    text-decoration: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.button-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 8, 68, 0.4);
}

.button-primary:hover {
    box-shadow: 0 6px 25px rgba(255, 8, 68, 0.6), 0 0 20px rgba(255, 8, 68, 0.3);
    transform: translateY(-2px);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.button-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 1000px;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

#caption {
    margin: 20px auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: var(--text-light);
    padding: 15px 0;
    font-size: 18px;
    font-weight: 500;
}

.close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: var(--text-light);
    font-size: 50px;
    font-weight: bold;
    transition: var(--transition);
    cursor: pointer;
    z-index: 2001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.close:hover {
    background: var(--primary-color);
    transform: rotate(90deg);
}

.modal-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    transform: translateY(-50%);
    pointer-events: none;
}

.modal-nav {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 50%;
    transition: var(--transition);
    pointer-events: all;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-nav:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* ===== Iframe Grid ===== */
.iframe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px 0;
    justify-content: center;
}

.iframe-container {
    width: 100%;
    max-width: 500px;
    padding-bottom: 56.25%;
    position: relative;
    margin: 0 auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.iframe-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(255, 8, 68, 0.3);
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 15px;
}

/* ===== Scroll to Top Button ===== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 8, 68, 0.5), 0 0 30px rgba(255, 8, 68, 0.3);
}

/* ===== Footer ===== */
.footer {
    background: var(--card-bg);
    padding: 60px 5% 20px;
    margin-top: 80px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-light);
}

.footer-section p {
    color: var(--text-gray);
    line-height: 1.8;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition);
    font-size: 18px;
}

.social-link:hover {
    background: var(--gradient-primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.footer-links,
.footer-contact {
    list-style: none;
    padding: 0;
}

.footer-links li,
.footer-contact li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-contact li {
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-contact i {
    color: var(--primary-color);
    width: 20px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-gray);
}

/* ===== Responsive Design ===== */
@media only screen and (max-width: 1024px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .template-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }
}

/* Responsive image heights */
@media only screen and (min-width: 1200px) {
    .template-image {
        height: 220px;
    }
}

@media only screen and (max-width: 1024px) {
    .template-image {
        height: 200px;
    }
}

@media only screen and (max-width: 820px) {
    .navbar-links {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 300px;
        height: calc(100vh - 70px);
        background: rgba(26, 31, 58, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 30px;
        transition: var(--transition);
        box-shadow: -5px 0 20px rgba(0,0,0,0.3);
    }
    
    .navbar-links.active {
        right: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-link {
        width: 100%;
        padding: 15px 20px;
    }
    
    .hero-section {
        padding: 120px 5% 60px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        gap: 30px;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .template-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media only screen and (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
    }
    
    .buttons {
        flex-direction: column;
    }
    
    .button {
        width: 100%;
    }
    
    .iframe-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal-controls {
        padding: 0 10px;
    }
    
    .modal-nav {
        width: 50px;
        height: 50px;
        padding: 10px 15px;
        font-size: 20px;
    }
    
    .close {
        top: 10px;
        right: 20px;
        font-size: 40px;
        width: 40px;
        height: 40px;
    }
    
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff0844 0%, #ff6b9d 100%);
}

/* ===== Selection ===== */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}
