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

:root {
    --vnr-red: #dc2626; 
    --vnr-red-dark: #991b1b;
    --bg-main: #f4f4f5; 
    --bg-card: #ffffff;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.02);
    --shadow-lg: 0 15px 30px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: var(--bg-main); color: var(--text-dark); -webkit-font-smoothing: antialiased; }

header { background: var(--bg-card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); }
.nav-container { max-width: 1280px; margin: 0 auto; padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; }
.logo-container { display: flex; align-items: center; gap: 1rem; text-decoration: none; }
.logo-img { height: 40px; width: auto; border-radius: 4px; }
.logo-text { font-size: 1.5rem; font-weight: 800; color: var(--text-dark); letter-spacing: -1px; }
.logo-text span { color: var(--vnr-red); }
.nav-links a { margin-left: 2rem; text-decoration: none; color: var(--text-dark); font-weight: 600; transition: color 0.2s; }
.nav-links a:hover { color: var(--vnr-red); }
.btn-admin { border: 2px solid var(--vnr-red); color: var(--vnr-red) !important; padding: 0.5rem 1.5rem; border-radius: 8px; }
.btn-admin:hover { background: var(--vnr-red); color: white !important; }

.hero { 
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%); 
    padding: 3.5rem 2rem; 
    text-align: center; 
    color: white; 
    box-shadow: inset 0 -10px 20px rgba(0,0,0,0.1);
}
.hero h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.5rem; color: white; text-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.hero p { color: #fecaca; font-size: 1.1rem; max-width: 700px; margin: 0 auto; line-height: 1.6; }

.container { max-width: 1280px; margin: 3rem auto; padding: 0 2rem; }
.section-title { font-size: 1.75rem; font-weight: 800; margin-bottom: 2rem; display: flex; justify-content: space-between; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; }
.card { background: var(--bg-card); border-radius: 16px; padding: 0.75rem; box-shadow: var(--shadow-sm); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer; border: 1px solid var(--border); display: flex; flex-direction: column; }
.card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(220, 38, 38, 0.08); border-color: #fca5a5; }
.card-img { width: 100%; height: 240px; object-fit: cover; border-radius: 10px; border: 1px solid rgba(0,0,0,0.04); margin-bottom: 0.5rem; }
.card-content { padding: 1rem 0.5rem 0.5rem 0.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.card-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.5rem; }
.card-details { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px dashed var(--border); }
.card-price { font-size: 1.75rem; font-weight: 800; color: var(--vnr-red); margin-bottom: 1rem; }
.btn-detalhes { width: 100%; padding: 0.75rem; border: 1px solid var(--border); border-radius: 8px; background: #f9fafb; color: var(--text-dark); font-weight: 700; cursor: pointer; transition: all 0.2s; margin-top: auto; }
.card:hover .btn-detalhes { background: var(--vnr-red); color: white; border-color: var(--vnr-red); }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content { background: var(--bg-card); width: 95%; max-width: 1100px; border-radius: 16px; overflow: hidden; display: grid; grid-template-columns: 1.2fr 1fr; position: relative; max-height: 90vh; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: white; border: 1px solid var(--border); width: 40px; height: 40px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; box-shadow: var(--shadow-sm); z-index: 10; font-weight: bold; color: var(--text-dark); transition: all 0.2s; }
.modal-close:hover { background: var(--vnr-red); color: white; border-color: var(--vnr-red); }

#auth-modal { background: rgba(0,0,0,0.92); }
.auth-box { background: white; padding: 3rem; border-radius: 12px; text-align: center; max-width: 400px; width: 90%; box-shadow: var(--shadow-lg); position: relative; }
.auth-box input { margin-bottom: 1rem; text-align: center; font-size: 1.25rem; letter-spacing: 2px; }

.modal-gallery-wrapper { background: #f9fafb; padding: 2rem; display: flex; flex-direction: column; border-right: 1px solid var(--border); overflow-y: auto; max-height: 90vh; }
.modal-main-img { width: 100%; height: 400px; object-fit: cover; border-radius: 12px; margin-bottom: 1rem; box-shadow: var(--shadow-sm); }
.modal-thumbnails { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.modal-thumb { width: 80px; height: 60px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; transition: all 0.2s; opacity: 0.6; }
.modal-thumb:hover { opacity: 1; }
.modal-thumb.active { border-color: var(--vnr-red); opacity: 1; }

.modal-info { padding: 2.5rem; overflow-y: auto; background: white; max-height: 90vh; }
.modal-info h2 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.modal-info .price { font-size: 2.5rem; color: var(--vnr-red); font-weight: 800; margin-bottom: 1.5rem; display: block; }
.specs { list-style: none; margin-bottom: 2rem; }
.specs li { display: flex; justify-content: space-between; padding: 0.75rem 0; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.specs li span { font-weight: 600; color: var(--text-dark); }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.5rem; font-size: 0.9rem; }
.form-control { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; background: var(--bg-card); outline: none; transition: border-color 0.2s; }
.form-control:focus { border-color: var(--vnr-red); box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1); }
.btn-primary { width: 100%; background: var(--vnr-red); color: white; border: none; padding: 1rem; font-size: 1.1rem; font-weight: 600; border-radius: 8px; cursor: pointer; transition: background 0.2s; }
.btn-primary:hover { background: var(--vnr-red-dark); }
.btn-secondary { background: #e5e7eb; color: var(--text-dark); border: none; padding: 1rem; font-size: 1.1rem; font-weight: 600; border-radius: 8px; cursor: pointer; transition: background 0.2s; }
.btn-secondary:hover { background: #d1d5db; }

.admin-panel { max-width: 950px; background: white; padding: 3rem; margin: 3rem auto; border-radius: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 2rem; }
.admin-table th, .admin-table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.admin-table th { background: var(--bg-main); font-weight: 600; border-radius: 6px 6px 0 0; }
.btn-danger { background: #fee2e2; color: #dc2626; border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-weight: 600; transition: background 0.2s;}
.btn-danger:hover { background: #fecaca; }
.btn-edit { background: #e0f2fe; color: #0284c7; border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-weight: 600; transition: background 0.2s; margin-right: 0.5rem; }
.btn-edit:hover { background: #bae6fd; }

.btn-move { background: #f3f4f6; color: #374151; border: 1px solid var(--border); padding: 0.4rem 0.6rem; border-radius: 6px; cursor: pointer; font-size: 1rem; margin-right: 0.2rem; transition: 0.2s; }
.btn-move:hover { background: #e5e7eb; }
.btn-move:disabled { opacity: 0.3; cursor: not-allowed; filter: grayscale(100%); }

.foto-input-group { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; background: #f3f4f6; padding: 10px; border-radius: 8px; border: 1px solid var(--border); }
.foto-file-input { flex: 1; padding: 0.5rem; border: none; background: transparent; }
.upload-status { font-size: 0.85rem; font-weight: bold; min-width: 120px; text-align: center; }
.upload-status.success { color: #16a34a; }
.btn-add-foto { background: #e5e7eb; color: var(--text-dark); border: none; padding: 0.75rem 1rem; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 0.9rem; margin-bottom: 1rem; transition: background 0.2s; display: inline-block; }
.btn-add-foto:hover { background: #d1d5db; }
.btn-remove-foto { background: #fee2e2; color: #dc2626; border: none; padding: 0.5rem 1rem; border-radius: 8px; cursor: pointer; font-weight: bold; transition: background 0.2s;}
.btn-remove-foto:hover { background: #fca5a5; }

@media (max-width: 900px) {
    .modal-content { grid-template-columns: 1fr; overflow-y: auto; max-height: 95vh; width: 100%; border-radius: 0; }
    .modal-gallery-wrapper { border-right: none; border-bottom: 1px solid var(--border); padding: 1.5rem; max-height: unset; overflow-y: visible; }
    .modal-info { max-height: unset; overflow-y: visible; }
    .nav-links a:not(.btn-admin) { display: none; }
    .admin-table th, .admin-table td { padding: 0.5rem; font-size: 0.85rem; }
    .btn-edit, .btn-danger, .btn-move { padding: 0.4rem 0.5rem; margin-bottom: 0.2rem; display: inline-block; }
}