/* ===================================
   CSS VARIABLES & RESET
   =================================== */
:root {
    /* Color Palette */
    --navy-dark: #0a0e27;
    --navy-medium: #1a1f3a;
    --navy-light: #2d3561;
    --cyan: #00d4ff;
    --cyan-dark: #00a8cc;
    --orange: #ff8c00;
    --orange-dark: #e67e00;    
    --white: #ffffff;
    --light-gray: #b8c2cc;
    --medium-gray: #6c757d;
    
    /* Gradients */
    --gradient-cyan: linear-gradient(135deg, #00d4ff 0%, #00a8cc 100%);
    --gradient-orange: linear-gradient(135deg, #ff8c00 0%, #e67e00 100%);
    --gradient-dark: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    --gradient-mixed: linear-gradient(135deg, #00d4ff 0%, #ff8c00 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 212, 255, 0.1);
    --shadow-md: 0 4px 15px rgba(0, 212, 255, 0.15);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-cyan: 0 0 25px rgba(0, 212, 255, 0.3);
    --shadow-orange: 0 0 25px rgba(255, 140, 0, 0.3);
    
    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===================================
   BASE STYLES
   =================================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--navy-dark);
    min-height: 100vh;
    color: var(--light-gray);
    line-height: 1.6;
}

/* ===================================
   HEADER & NAVIGATION
   =================================== */
header {
    background: var(--navy-medium);
    color: var(--white);
    padding: 20px 40px;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid rgba(0, 212, 255, 0.2);
}

header h1 {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-mixed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

nav {
    display: flex;
    gap: 25px;
    align-items: center;
}

nav a {
    color: var(--light-gray);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 0;
}

nav a:hover {
    color: var(--cyan);
    transform: translateY(-2px);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-cyan);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

#userDisplay {
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 20px;
}

#userDisplay:hover {
    background: rgba(0, 212, 255, 0.1);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* ===================================
   MAIN CONTENT
   =================================== */
main {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
}

/* ===================================
   FORMS & AUTHENTICATION
   =================================== */
.form-container {
    background: var(--navy-medium);
    padding: 40px;
    max-width: 450px;
    margin: 40px auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0, 212, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-mixed);
}

.form-container h2 {
    margin-bottom: 25px;
    color: var(--white);
    font-size: 1.8rem;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--cyan);
    font-size: 0.95rem;
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--navy-light);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--navy-dark);
    color: var(--white);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--cyan);
    background: var(--navy-dark);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

input::placeholder {
    color: var(--medium-gray);
}

button {
    width: 100%;
    padding: 14px;
    background: var(--gradient-cyan);
    color: var(--navy-dark);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-cyan);
    background: var(--gradient-mixed);
}

button:active {
    transform: translateY(0);
}

.form-container p {
    text-align: center;
    margin-top: 20px;
    color: var(--light-gray);
    font-size: 0.95rem;
}

.form-container a {
    color: var(--orange);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.form-container a:hover {
    color: var(--cyan);
    text-decoration: underline;
}

/* ===================================
   MESSAGES & ALERTS
   =================================== */
.message {
    padding: 14px 18px;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    animation: slideIn 0.4s ease-out;
}

.message.success {
    background-color: rgba(0, 212, 255, 0.1);
    color: var(--cyan);
    border-left: 4px solid var(--cyan);
}

.message.error {
    background-color: rgba(255, 140, 0, 0.1);
    color: var(--orange);
    border-left: 4px solid var(--orange);
}

.error {
    color: var(--orange);
    background: rgba(255, 140, 0, 0.1);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin: 10px 0;
    border-left: 4px solid var(--orange);
    display: none;
}

.success {
    color: var(--cyan);
    background: rgba(0, 212, 255, 0.1);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin: 10px 0;
    border-left: 4px solid var(--cyan);
    display: none;
}

.form-error {
    color: var(--orange);
    font-size: 0.875rem;
    margin-top: 6px;
    display: none;
    padding-left: 5px;
}

.auth-status {
    background: rgba(0, 212, 255, 0.2);
    color: var(--cyan);
    padding: 12px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

/* ===================================
   GAME CARDS & GRID
   =================================== */
.jogos-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.jogo-card {
    background: var(--navy-medium);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(0, 212, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.jogo-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-cyan);
    border-color: rgba(0, 212, 255, 0.3);
}

.jogo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-mixed);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.jogo-card:hover::before {
    opacity: 1;
}

.jogo-card h3 {
    padding: 20px 20px 10px;
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 700;
}

.jogo-card .info {
    padding: 0 20px 10px;
    color: var(--light-gray);
    font-size: 0.9rem;
}

.jogo-card .price {
    padding: 0 20px 20px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--orange);
}

    .cell-estado {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    text-transform: capitalize;
    margin: 0 20px 20px;
    align-self: flex-start;
}

.estado-novo { background: #22c55e; color: white; }
.estado-como-novo { background: #3b82f6; color: white; }
.estado-usado { background: #f59e0b; color: white; }

optgroup {
    color: var(--cyan);
    font-weight: bold;
}

option {
    color: var(--white);
    background: var(--navy-dark);
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.platform-card {
    background: var(--navy-medium);
    padding: 20px;
    text-align: center;
    border-radius: var(--radius-md);
    color: var(--cyan);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.platform-card:hover {
    background: var(--cyan);
    color: var(--navy-dark);
    transform: translateY(-3px);
}

.game-image-container {
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
    background: var(--navy-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-image:hover {
    transform: scale(1.05);
}

.game-image-placeholder {
    width: 100%;
    height: 180px;
    background: var(--navy-dark);
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.carrinho-btn {
    width: 100%;
    padding: 10px;
    background: var(--cyan);
    color: var(--navy-dark);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
}

/* Badge do carrinho na navbar */
.carrinho-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--orange);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

nav a {
    position: relative; /* Para o badge ficar posicionado corretamente */
}

/* ===================================
   FOOTER
   =================================== */
footer {
    background: var(--navy-medium);
    color: var(--light-gray);
    text-align: center;
    padding: 30px;
    margin-top: 60px;
    font-size: 0.9rem;
    border-top: 2px solid rgba(0, 212, 255, 0.1);
}

/* ===================================
   UTILITY CLASSES
   =================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

#logout {
    color: var(--orange);
    font-weight: 600;
}

#logout:hover {
    color: var(--cyan);
}

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 212, 255, 0.5); }
    50% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.8); }
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--cyan-dark);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--cyan);
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 768px) {
    header {
        padding: 15px 20px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    nav {
        gap: 15px;
        font-size: 0.9rem;
    }
    
    .form-container {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .jogos-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ===================================
   DM/MESSAGING STYLES
   =================================== */
.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gradient-mixed);
    color: var(--navy-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: var(--shadow-cyan);
}

.mensagem {
    background: var(--navy-medium);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s ease-out;
    border: 1px solid rgba(0, 212, 255, 0.1);
}

.mensagem .data {
    font-size: 0.8rem;
    color: var(--medium-gray);
    margin-top: 8px;
}

.messages-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
    background: var(--navy-dark);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 212, 255, 0.1);
}

.send-button {
    background: var(--gradient-orange);
    width: auto;
    padding: 12px 30px;
    color: var(--navy-dark);
    font-weight: 700;
}

.send-button:hover {
    background: var(--gradient-mixed);
    box-shadow: var(--shadow-orange);
}

/* ===================================
   CONTACTAR VENDEDOR BUTTON
   =================================== */
.btn-contactar {
    width: 100%;
    padding: 10px;
    background: var(--orange);
    color: var(--navy-dark);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}