@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header styles */
header {
    background-color: #2c3e50;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo img {
    max-height: 60px;
}

/* Main content styles */
main {
    padding: 30px 0;
    min-height: calc(100vh - 180px);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 2rem;
}

/* Games grid styles */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.game-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.game-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.game-info {
    padding: 15px;
}

.game-title {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #2c3e50;
}

.game-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.play-button {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.play-button:hover {
    background-color: #2980b9;
}

/* Game page styles */
.game-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.game-frame {
    width: 100%;
    height: 600px;
    border: none;
}

.game-details {
    padding: 20px;
}

.back-button {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 20px;
    transition: background-color 0.3s ease;
}

.back-button:hover {
    background-color: #2980b9;
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 30px;
    font-size: 1.2rem;
    color: #666;
}

/* Footer styles */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 20px 0;
    text-align: center;
}

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    color: #ecf0f1;
    margin: 0 10px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #3498db;
}

/* Responsive styles */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .game-frame {
        height: 450px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .game-frame {
        height: 350px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .footer-links a {
        display: block;
        margin: 10px 0;
    }
}
/* Index page styles */
body.index-page {
    font-family: 'Poppins', sans-serif;
    background-color: #0f172a;
    color: #e2e8f0;
}

.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #3b82f6;
    transition: width 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
}

.content-section {
    display: none;
}
.content-section.active {
    display: block;
}

.category-filter.active {
    background-color: #3b82f6;
    color: white;
}

#loading {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.9);
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Login page styles */
body.login-page {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.hidden {
    display: none;
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

.nav-link.active {
    border-bottom: 3px solid #4f46e5;
    color: #4f46e5;
}

.color-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-block;
    margin-right: 10px;
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}
.color-swatch.selected {
    border: 2px solid #000;
}

.custom-file-upload {
    border: 1px dashed #ccc;
    display: inline-block;
    padding: 6px 12px;
    cursor: pointer;
    background: #f9f9f9;
    border-radius: 4px;
    width: 100%;
    text-align: center;
}

.drag-area {
    border: 2px dashed #4f46e5;
    height: 200px;
    width: 100%;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin-bottom: 20px;
}
.drag-area.active {
    border: 2px solid #4f46e5;
    background-color: rgba(79, 70, 229, 0.1);
}

.progress {
    height: 10px;
    background-color: #e2e8f0;
    border-radius: 5px;
    margin: 10px 0;
}
.progress-bar {
    height: 100%;
    background-color: #4f46e5;
    border-radius: 5px;
    width: 0%;
}

.uploader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: '';
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #4f46e5;
}
input:checked + .slider:before {
    transform: translateX(26px);
}

.tooltip {
    position: relative;
    display: inline-block;
}
.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}
.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.game-preview {
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}
.theme-preview {
    width: 100%;
    height: 120px;
    border-radius: 5px;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
}
.sample-text {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
}

/* Generator pages */
.generator-container {
    max-width: 800px;
    margin: 50px auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-group textarea {
    height: 100px;
}

.generate-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}
.generate-button:hover {
    background-color: #2980b9;
}

.result-container {
    margin-top: 30px;
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: 4px;
    display: none;
}
.result-container pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.copy-button {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}
.copy-button:hover {
    background-color: #27ae60;
}

.progress-container {
    margin-top: 20px;
    display: none;
}
.progress-bar {
    height: 20px;
    background-color: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}
.progress {
    height: 100%;
    background-color: #3498db;
    width: 0%;
    transition: width 0.3s ease;
}
.status {
    font-size: 14px;
    color: #666;
}

/* Dashboard page */
.dashboard-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.dashboard-header {
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dashboard-header h1 {
    margin: 0;
    color: white;
}
.logout-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}
.dashboard-content {
    padding: 20px;
}
.dashboard-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}
.tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #666;
}
.tab-button.active {
    color: #3498db;
    border-bottom: 3px solid #3498db;
}
.game-list {
    width: 100%;
    border-collapse: collapse;
}
.game-list th,
.game-list td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
.game-list th {
    background-color: #f5f5f5;
}
.action-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
}
.delete-button {
    background-color: #e74c3c;
}
.add-game-form {
    max-width: 600px;
}
.submit-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

/* Analytics page */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #3498db;
    margin: 10px 0;
}
.stat-label {
    font-size: 0.9rem;
    color: #666;
}
.chart-container {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.chart-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: #333;
}
.chart {
    height: 300px;
    width: 100%;
    background-color: #fff;
    border-radius: 4px;
    display: flex;
    align-items: flex-end;
    padding: 10px;
    box-sizing: border-box;
}
.chart-bar {
    flex: 1;
    background-color: #3498db;
    margin: 0 5px;
    position: relative;
    transition: height 0.5s ease;
}
.chart-bar-label {
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
}
.chart-bar-value {
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.8rem;
    color: #333;
}
.top-games {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
}
.top-games-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: #333;
}
.top-games-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.top-game-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}
.top-game-item:last-child {
    border-bottom: none;
}
.top-game-rank {
    font-size: 1.2rem;
    font-weight: 700;
    color: #3498db;
    margin-right: 15px;
    min-width: 30px;
}
.top-game-info {
    flex: 1;
}
.top-game-title {
    font-weight: 600;
    margin-bottom: 5px;
}
.top-game-plays {
    font-size: 0.9rem;
    color: #666;
}
