* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #6C63FF;
    min-height: 100vh;
    padding: 20px;
    color: #FFFFFF;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.logo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    margin-top: 10px;
}

/* Mensagens */
.message {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

.message.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.message.error {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
}

.controls {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.search-form {
    margin-bottom: 20px;
}

.search-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #6C63FF 0%, #3A3A80 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    text-decoration: none;
    display: inline-block;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.filter-btn.active {
    background: linear-gradient(135deg, #FFD369 0%, #ee5a24 100%);
}

.filter-count {
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 12px;
    margin-left: 5px;
}

.admin-btn {
    background: linear-gradient(135deg, #FF4C29 0%, #FFD369 100%);
    color: #1F1F2E;
    margin-left: auto;
    font-size: 18px;
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.product-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.product-number {
    position: absolute;
    top: -10px;
    left: 20px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.product-image {
    width: 100%;
    height: 200px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.product-image.no-image {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    font-size: 14px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
}

.category-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #6C63FF 0%, #3A3A80 100%);
    border: 2px solid #FFFFFF;
    color: white;
}

.buy-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #FFD369 0%, #ee5a24 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    text-align: center;
}

.buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(238, 90, 36, 0.4);
}

.admin-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
    gap: 5px;
}

.admin-controls.show {
    display: flex;
}

.admin-control-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
}

.edit-btn {
    background: #007bff;
}

.delete-btn {
    background: #dc3545;
}

.stats {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 15px;
    padding: 30px;
    color: white;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item h3 {
    font-size: 2rem;
    margin-bottom: 5px;
    color: #4facfe;
}

.stat-item p {
    color: rgba(255,255,255,0.8);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-input, .form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #4facfe;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.no-products {
    text-align: center;
    padding: 60px 20px;
    color: #FFFFFF;
}

.no-products h3 {
    color: #FFD369;
    margin-bottom: 10px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #FFFFFF;
}

.product-count {
    text-align: center;
    margin-bottom: 20px;
    color: #FFFFFF;
    font-size: 14px;
}

/* Cores das categorias */
.category-teclado { 
    background: linear-gradient(135deg, #FF4C29 0%, #FF6F61 100%); 
    border: 2px solid #FFFFFF; 
    color: white;
}

.category-mouse { 
    background: linear-gradient(135deg, #FFD369 0%, #FF4C29 100%); 
    border: 2px solid #FFFFFF; 
    color: white;
}

.category-headset { 
    background: linear-gradient(135deg, #6C63FF 0%, #3A3A80 100%); 
    border: 2px solid #FFFFFF; 
    color: white;
}

.category-cooler { 
    background: linear-gradient(135deg, #3DD598 0%, #1F1F2E 100%); 
    border: 2px solid #FFFFFF; 
    color: white;
}

.category-gabinete { 
    background: linear-gradient(135deg, #1F1F2E 0%, #2F2F3E 100%); 
    border: 2px solid #FFFFFF; 
    color: white;
}

.category-fonte { 
    background: linear-gradient(135deg, #FF6F61 0%, #FF4C29 100%); 
    border: 2px solid #FFFFFF; 
    color: white;
}

.category-mousepad { 
    background: linear-gradient(135deg, #FFD369 0%, #FF6F61 100%); 
    border: 2px solid #FFFFFF; 
    color: white;
}

.category-cadeira { 
    background: linear-gradient(135deg, #6C63FF 0%, #FF4C29 100%); 
    border: 2px solid #FFFFFF; 
    color: white;
}

.category-controle { 
    background: linear-gradient(135deg, #FF4C29 0%, #FFD369 100%); 
    border: 2px solid #FFFFFF; 
    color: white;
}

.category-ssd { 
    background: linear-gradient(135deg, #FF6F61 0%, #6C63FF 100%); 
    border: 2px solid #FFFFFF; 
    color: white;
}

.category-acessório { 
    background: linear-gradient(135deg, #3DD598 0%, #FFD369 100%); 
    border: 2px solid #FFFFFF; 
    color: white;
}



/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .filters {
        justify-content: center;
    }
    
    .filter-btn {
        font-size: 14px;
        padding: 8px 16px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .admin-btn {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* Estilos para a página de gerenciamento */
.admin-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.nav-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #6C63FF 0%, #3A3A80 100%);
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.logout-btn {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

.admin-controls-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.control-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.add-category-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.add-product-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.management-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.management-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: bold;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th,
.admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    color: #222;
}

.admin-table th {
    background: linear-gradient(135deg, #6C63FF 0%, #3A3A80 100%);
    color: white;
    font-weight: 500;
}

.admin-table tr:hover {
    background: #f8f9fa;
}

.action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 5px;
    transition: all 0.3s ease;
}

.edit-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
    color: white;
}

.delete-btn {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
}

.action-btn:hover {
    transform: scale(1.1);
}

.link-preview {
    color: #6C63FF;
    text-decoration: none;
    font-weight: 500;
}

.link-preview:hover {
    text-decoration: underline;
}

.has-image {
    color: #28a745;
    font-weight: bold;
}

.no-image {
    color: #dc3545;
    font-weight: bold;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.category-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.category-item:hover {
    border-color: #6C63FF;
    transform: translateY(-2px);
}

.category-count {
    background: #6C63FF;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-data h3 {
    margin-bottom: 10px;
    color: #333;
}

/* Responsividade para gerenciamento */
@media (max-width: 768px) {
    .admin-nav {
        flex-direction: column;
        gap: 15px;
    }
    
    .control-buttons {
        flex-direction: column;
    }
    
    .admin-table {
        font-size: 14px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 10px 8px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
}