/* CSS Variables are now defined in theme.php from config.php */
/* Do not redefine CSS variables here as they will override theme.php */

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light-color);
    min-height: 100vh;
    color: var(--dark-color);
}

/* Simple Beautiful Header */
.simple-header {
    background: var(--primary-gradient);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.simple-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.simple-header .navbar {
    background: transparent !important;
    padding: 1rem 0;
    position: relative;
    z-index: 2;
}

.simple-header .navbar-brand {
    font-size: 1.5rem;
    color: white !important;
    text-decoration: none;
    transition: all 0.3s ease;
}

.simple-header .navbar-brand:hover {
    transform: translateY(-2px);
    color: rgba(255, 255, 255, 0.9) !important;
}

.simple-header .navbar-brand i {
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.3s ease;
}

.simple-header .navbar-brand:hover i {
    transform: rotate(10deg);
}

.simple-header .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.simple-header .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.simple-header .nav-link.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.simple-header .navbar-toggler {
    border: none;
    color: white;
}

.simple-header .navbar-toggler:focus {
    box-shadow: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 2.5rem 0;
    min-height: 200px;
    display: flex;
    align-items: center;
}

.hero-content .container {
    width: 100%;
}

.hero-content h1 {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.8s ease-out;
    margin-bottom: 1rem;
}

.hero-content p,
.hero-content .lead {
    animation: fadeInUp 0.8s ease-out 0.2s both;
    color: rgba(255, 255, 255, 1) !important;
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-content .header-icon {
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.hero-content .header-icon i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.8);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design for Headers */
@media (max-width: 768px) {
    .hero-content {
        padding: 2.5rem 0;
        min-height: 180px;
    }
    
    .hero-content h1 {
        font-size: 2.2rem !important;
        margin-bottom: 1rem;
        font-weight: 700;
    }
    
    .hero-content p,
    .hero-content .lead {
        font-size: 1rem !important;
        color: rgba(255, 255, 255, 1) !important;
        font-weight: 600;
        line-height: 1.4;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .hero-content .header-icon i {
        font-size: 2.5rem;
    }
    
    .simple-header .navbar-brand {
        font-size: 1.25rem;
    }
    
    .simple-header .nav-link {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.9rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .hero-content {
        padding: 2rem 0;
        min-height: 140px;
    }
    
    .hero-content h1 {
        font-size: 1.8rem !important;
        margin-bottom: 0.75rem;
        font-weight: 700;
    }
    
    .hero-content p,
    .hero-content .lead {
        font-size: 0.95rem !important;
        color: rgba(255, 255, 255, 1) !important;
        font-weight: 600;
        line-height: 1.3;
        margin-bottom: 0;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
        max-width: 95%;
        margin-left: auto;
        margin-right: auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 576px) {
    .hero-content {
        padding: 2.5rem 0;
        min-height: 160px;
    }
    
    .hero-content h1 {
        font-size: 2rem !important;
        margin-bottom: 1rem;
        font-weight: 700;
    }
    
    .hero-content .header-icon i {
        font-size: 2rem;
    }
    
    .hero-content p,
    .hero-content .lead {
        font-size: 1rem !important;
        color: rgba(255, 255, 255, 1) !important;
        font-weight: 600;
        line-height: 1.4;
        margin-bottom: 0;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
        max-width: 90%;
        margin-left: auto;
        margin-right: auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .simple-header .navbar-brand {
        font-size: 1.2rem;
    }
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-section {
        margin-bottom: 2rem;
    }
    
    .footer-social {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .footer-bottom {
        text-align: center;
        padding-top: 1.5rem;
    }
}

@media (max-width: 576px) {
    .footer-section h5 {
        font-size: 1rem;
    }
    
    .footer-links a {
        font-size: 0.9rem;
    }
    
    .footer-bottom p {
        font-size: 0.8rem;
    }
}

/* Hero Section */
.hero {
    background: var(--primary-gradient);
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero .container {
    position: relative;
    z-index: 2;
}

/* Navigation */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 4px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Game Cards */
.game-card {
    background: var(--card-bg);
    border: none;
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    height: 100%;
    backdrop-filter: blur(10px);
}

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.game-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover img {
    transform: scale(1.1);
}

.game-card .card-body {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
}

.game-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--dark-color);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.play-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.game-card:hover .play-icon {
    color: var(--secondary-color);
    transform: scale(1.2);
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 30px 30px 0 0;
    margin-top: -30px;
    position: relative;
    z-index: 3;
    min-height: calc(100vh - 200px);
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.1);
}

/* Search Bar */
.search-container {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin: 2rem 0;
    backdrop-filter: blur(10px);
}

.search-input {
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    padding: 12px 20px 12px 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-10);
    background: white;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    z-index: 3;
}

.search-btn {
    background: var(--primary-gradient);
    border: none;
    border-radius: 50px;
    padding: 12px 30px;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-40);
    color: white;
}

.clear-search {
    background: transparent;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    padding: 12px 20px;
    color: #a0aec0;
    transition: all 0.3s ease;
}

.clear-search:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-10);
}

/* Pagination */
.pagination-container {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin: 2rem 0;
    backdrop-filter: blur(10px);
}

.pagination {
    margin: 0;
    justify-content: center;
    gap: 8px;
}

.page-link {
    border: none;
    background: var(--primary-10);
    color: var(--primary-color);
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.page-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    transition: left 0.3s ease;
    z-index: -1;
}

.page-link:hover::before {
    left: 0;
}

.page-link:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--primary-30);
}

.page-item.active .page-link {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px var(--primary-40);
    transform: translateY(-2px);
}

.page-item.active .page-link::before {
    display: none;
}

.page-item.disabled .page-link {
    color: #a0aec0;
    background: rgba(160, 174, 192, 0.1);
    cursor: not-allowed;
    transform: none;
}

.page-item.disabled .page-link::before {
    display: none;
}

.page-item.disabled .page-link:hover {
    transform: none;
    box-shadow: none;
}

.pagination-info {
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.pagination-info .badge {
    background: var(--primary-gradient);
    color: white;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
}

/* Game Detail Page */
.game-banner {
    background: var(--primary-gradient);
    color: var(--text-light);
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.game-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
}

.game-icon {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.game-icon:hover {
    transform: scale(1.05);
}

.play-button {
    background: var(--secondary-gradient);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
    position: relative;
    overflow: hidden;
    min-width: 160px;
    text-align: center;
    white-space: nowrap;
}

.play-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.play-button:hover::before {
    left: 100%;
}

.play-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(240, 147, 251, 0.6);
    color: white;
    text-decoration: none;
}

/* Game Description */
.game-description {
    padding: 3rem 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

/* Game Container */
.game-container {
    width: 100%;
    height: 100vh;
    background: #000;
    position: relative;
    overflow: hidden;
}

.game-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Tablet Responsiveness */
@media (max-width: 991px) and (min-width: 769px) {
    .container.px-4.px-lg-5 {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
    
    .game-card img {
        height: 160px;
    }
    
    .play-button {
        padding: 13px 35px;
        font-size: 1.15rem;
    }
    
    .hero-content {
        padding: 2rem 0;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .game-card img {
        height: 150px;
    }
    
    .game-card .card-body {
        padding: 1rem;
    }
    
    .game-title {
        font-size: 0.9rem;
    }
    
    .page-link {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }
    
    .game-icon {
        width: 120px;
        height: 120px;
    }
    
    .play-button {
        padding: 12px 30px;
        font-size: 1.1rem;
        min-width: 140px;
        width: 100%;
        max-width: 200px;
    }
    
    .search-container {
        padding: 1.5rem;
    }
    
    .search-input {
        padding: 10px 15px 10px 45px;
        font-size: 0.9rem;
    }
    
    .search-icon {
        left: 15px;
    }
    
    .pagination-container {
        padding: 1rem;
    }
    
    .pagination-info {
        font-size: 0.8rem;
    }
    
    /* Detail page specific responsive styles */
    .card.game-card .row.g-0 {
        flex-direction: column;
    }
    
    .card.game-card .col-md-5,
    .card.game-card .col-md-7 {
        flex: 1;
        max-width: 100%;
    }
    
    .d-grid.gap-2.d-md-flex {
        flex-direction: column !important;
    }
    
    .d-grid.gap-2.d-md-flex .play-button {
        margin-bottom: 0.5rem;
    }
}

/* Extra extra small devices (iPhone SE and smaller) */
@media (max-width: 360px) {
    .hero-content {
        padding: 2rem 0;
        min-height: 130px;
    }
    
    .hero-content h1 {
        font-size: 1.6rem !important;
        margin-bottom: 0.5rem;
        font-weight: 700;
    }
    
    .hero-content p,
    .hero-content .lead {
        font-size: 0.9rem !important;
        color: rgba(255, 255, 255, 1) !important;
        font-weight: 600;
        line-height: 1.3;
        margin-bottom: 0;
        text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
        max-width: 100%;
        padding: 0 0.5rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 576px) {
    .main-content {
        margin-top: -30px;
        border-radius: 20px 20px 0 0;
    }
    
    .game-card {
        border-radius: 15px;
    }
    
    .game-card img {
        height: 120px;
    }
    
    .page-link {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
        margin: 0 2px;
    }
    
    .pagination-container {
        padding: 1.5rem;
        margin: 2rem 0;
    }
    
    .play-button {
        padding: 10px 25px;
        font-size: 1rem;
        min-width: 120px;
        width: 100%;
        max-width: 180px;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .hero-content p {
        font-size: 0.9rem;
    }
    
    .container.px-4.px-lg-5 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Improve footer layout on mobile */
    footer .col-lg-4,
    footer .col-lg-2 {
        margin-bottom: 1.5rem;
    }
    
    footer .col-lg-4 {
        order: 1;
    }
    
    footer .col-lg-2:nth-child(2) {
        order: 2;
    }
    
    footer .col-lg-2:nth-child(3) {
        order: 3;
    }
    
    /* Social links and touch targets */
    .social-link,
    .nav-link,
    .btn {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Mobile typography improvements */
    .display-5 {
        font-size: 2.5rem !important;
    }
    
    .display-4 {
        font-size: 2rem !important;
    }
    
    .fs-1 {
        font-size: 1.5rem !important;
    }
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card {
    animation: fadeInUp 0.6s ease-out;
}

.game-card:nth-child(1) { animation-delay: 0.1s; }
.game-card:nth-child(2) { animation-delay: 0.2s; }
.game-card:nth-child(3) { animation-delay: 0.3s; }
.game-card:nth-child(4) { animation-delay: 0.4s; }
.game-card:nth-child(5) { animation-delay: 0.5s; }

/* Beautiful Simple Footer */
footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--darker-bg) 100%);
    color: white;
    padding: 2rem 0 1rem;
    margin-top: 3rem;
    position: relative;
    overflow: hidden;
}

footer .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="footer-grain" width="50" height="50" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="10" cy="10" r="0.3" fill="rgba(255,255,255,0.03)"/><circle cx="40" cy="40" r="0.3" fill="rgba(255,255,255,0.03)"/></pattern></defs><rect width="100" height="100" fill="url(%23footer-grain)"/></svg>');
    opacity: 0.4;
    pointer-events: none;
}

.footer-content {
    position: relative;
    z-index: 2;
}

.footer-section h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 1.5rem;
    position: relative;
}

.footer-section h5::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(3px);
}

.footer-links a i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.3rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

/* Ensure Bootstrap Icons are loaded and visible */
.social-link i {
    font-family: 'bootstrap-icons' !important;
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    display: inline-block;
}

/* Fallback text for social links if icons don't load */
.social-link::after {
    content: attr(title);
    font-size: 0.6rem;
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.social-link:hover::after {
    opacity: 0.8;
}

.social-link:hover {
    background: var(--primary-color);
    color: white !important;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
    padding-top: 2rem;
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.footer-bottom a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.footer-bottom a:hover {
    color: white;
    text-decoration: underline;
}

/* Newsletter Form (removed) */

/* Utility Classes */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}