/* ==========================================================================
   GV-Marketplace - Estilos Responsive App-Style
   Versión móvil-first para Web App
   ========================================================================== */

/* Variables CSS */
:root {
    --gv-primary: #006B28;
    --gv-primary-dark: #005520;
    --gv-primary-light: #008030;
    --gv-secondary: #252074;
    --gv-secondary-light: #2d2690;
    --gv-accent: #ff6b35;
    --gv-success: #10b981;
    --gv-warning: #f59e0b;
    --gv-danger: #ef4444;
    --gv-info: #0ea5e9;
    --gv-bg: #f8fafc;
    --gv-bg-card: #ffffff;
    --gv-border: #e2e8f0;
    --gv-text: #1e293b;
    --gv-text-muted: #64748b;
    --gv-radius: 12px;
    --gv-radius-sm: 8px;
    --gv-radius-lg: 16px;
    --gv-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --gv-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --gv-transition: all 0.2s ease;
    --gv-max-width: 1400px;
    --gv-header-height: 56px;
    --gv-bottom-nav-height: 64px;
    --whatsapp-green: #25D366;
}

/* Reset y base */
.gv-app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--gv-text);
    background: var(--gv-bg);
    min-height: 100vh;
    max-width: var(--gv-max-width);
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

.gv-app *, .gv-app *::before, .gv-app *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.gv-page-header {
    background: var(--gv-bg-card);
    padding: 20px 16px;
    border-bottom: 1px solid var(--gv-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.gv-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gv-page-title .gv-icon {
    width: 28px;
    height: 28px;
}

.gv-page-subtitle {
    color: var(--gv-text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* ==========================================================================
   BOTONES
   ========================================================================== */

.gv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--gv-radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: var(--gv-transition);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.gv-btn:active {
    transform: scale(0.97);
}

.gv-btn-primary {
    background: var(--gv-primary);
    color: white;
}

.gv-btn-primary:hover, .gv-btn-primary:focus {
    background: var(--gv-primary-dark);
    color: white;
}

.gv-btn-secondary {
    background: var(--gv-bg);
    color: var(--gv-text);
    border: 1px solid var(--gv-border);
}

.gv-btn-secondary:hover {
    background: var(--gv-border);
}

.gv-btn-success, .gv-btn-whatsapp {
    background: var(--whatsapp-green);
    color: white;
}

.gv-btn-whatsapp:hover, .gv-btn-whatsapp:focus {
    background: #20bd5a;
    color: white;
}

.gv-btn-danger {
    background: var(--gv-danger);
    color: white;
}

.gv-btn-ghost {
    background: transparent;
    color: var(--gv-text-muted);
}

.gv-btn-ghost:hover {
    background: var(--gv-bg);
}

.gv-btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.gv-btn-lg {
    padding: 16px 28px;
    font-size: 1rem;
}

.gv-btn-block {
    width: 100%;
}

.gv-btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ==========================================================================
   FORMULARIOS
   ========================================================================== */

.gv-form {
    padding: 16px;
}

.gv-form-section {
    background: var(--gv-bg-card);
    border-radius: var(--gv-radius);
    padding: 20px 16px;
    margin-bottom: 16px;
}

.gv-form-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gv-border);
}

.gv-form-group {
    margin-bottom: 16px;
}

.gv-form-group:last-child {
    margin-bottom: 0;
}

.gv-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (min-width: 400px) {
    .gv-form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.gv-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--gv-text);
}

.gv-input,
.gv-select,
.gv-textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    border: 1px solid var(--gv-border);
    border-radius: var(--gv-radius-sm);
    background: var(--gv-bg);
    transition: var(--gv-transition);
    -webkit-appearance: none;
    appearance: none;
}

.gv-input:focus,
.gv-select:focus,
.gv-textarea:focus {
    outline: none;
    border-color: var(--gv-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.gv-textarea {
    resize: vertical;
    min-height: 100px;
}

.gv-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.gv-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
}

.gv-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--gv-primary);
}

.gv-file-input {
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--gv-border);
    border-radius: var(--gv-radius-sm);
    background: var(--gv-bg);
    font-size: 0.9rem;
}

.gv-form-actions {
    padding: 16px;
    padding-bottom: 32px;
}

/* ==========================================================================
   TARJETAS Y LISTAS
   ========================================================================== */

.gv-section-card {
    background: var(--gv-bg-card);
    border-radius: var(--gv-radius);
    margin: 0 16px 16px;
    overflow: hidden;
}

.gv-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    padding: 16px;
    background: var(--gv-bg);
    border-bottom: 1px solid var(--gv-border);
}

.gv-section-content {
    padding: 16px;
    line-height: 1.6;
}

/* ==========================================================================
   FILTROS
   ========================================================================== */

.gv-filters-card {
    background: var(--gv-bg-card);
    border-radius: var(--gv-radius);
    margin: 0 16px 16px;
    padding: 16px;
}

.gv-search-box {
    position: relative;
    margin-bottom: 12px;
}

.gv-search-box .gv-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--gv-text-muted);
}

.gv-search-box input {
    padding-left: 44px;
}

.gv-filters-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

@media (min-width: 400px) {
    .gv-filters-row {
        grid-template-columns: 1fr 1fr;
    }
}

.gv-filters-actions {
    display: flex;
    gap: 12px;
}

.gv-filters-actions .gv-btn {
    flex: 1;
}

/* ==========================================================================
   GRID DE EMPLEOS Y PROPIEDADES
   ========================================================================== */

.gv-jobs-grid,
.gv-properties-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
}

@media (min-width: 400px) {
    .gv-jobs-grid,
    .gv-properties-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.gv-grid-2 {
    grid-template-columns: 1fr;
}

@media (min-width: 400px) {
    .gv-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Job Card */
.gv-job-card {
    background: var(--gv-bg-card);
    border-radius: var(--gv-radius);
    padding: 16px;
    box-shadow: var(--gv-shadow);
    transition: var(--gv-transition);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gv-job-card:hover {
    box-shadow: var(--gv-shadow-lg);
}

.gv-job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gv-job-type-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--gv-bg);
    color: var(--gv-text);
}

.gv-badge-full-time { background: #dbeafe; color: #1d4ed8; }
.gv-badge-part-time { background: #fef3c7; color: #d97706; }
.gv-badge-contract { background: #ede9fe; color: #7c3aed; }
.gv-badge-freelance { background: #d1fae5; color: #059669; }
.gv-badge-temporary { background: #fee2e2; color: #dc2626; }
.gv-badge-internship { background: #e0e7ff; color: #4f46e5; }

.gv-job-applicants {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--gv-text-muted);
}

.gv-job-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.gv-job-title a {
    color: var(--gv-text);
    text-decoration: none;
}

.gv-job-title a:hover {
    color: var(--gv-primary);
}

.gv-job-company,
.gv-job-location,
.gv-job-salary {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--gv-text-muted);
}

.gv-job-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--gv-border);
}

.gv-job-date {
    font-size: 0.8rem;
    color: var(--gv-text-muted);
}

/* ==========================================================================
   DETALLE DE EMPLEO
   ========================================================================== */

.gv-job-single-page {
    padding-bottom: 100px;
}

.gv-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    color: var(--gv-text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    background: var(--gv-bg-card);
    border-bottom: 1px solid var(--gv-border);
    width: 100%;
}

.gv-back-btn:hover {
    color: var(--gv-primary);
}

.gv-job-detail-header {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
    background: var(--gv-bg-card);
}

.gv-job-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    padding: 16px;
    background: var(--gv-bg-card);
}

.gv-job-meta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
    background: var(--gv-bg-card);
    margin-bottom: 16px;
}

@media (min-width: 400px) {
    .gv-job-meta-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.gv-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--gv-bg);
    border-radius: var(--gv-radius-sm);
}

.gv-meta-item svg {
    width: 20px;
    height: 20px;
    color: var(--gv-primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.gv-meta-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gv-text-muted);
    margin-bottom: 2px;
}

.gv-meta-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ==========================================================================
   FORMULARIO DE SOLICITUD
   ========================================================================== */

.gv-apply-section {
    background: var(--gv-bg-card);
    margin: 16px;
    padding: 20px;
    border-radius: var(--gv-radius);
    position: sticky;
    bottom: 80px;
}

.gv-apply-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.gv-success-message,
.gv-info-message,
.gv-closed-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: var(--gv-radius-sm);
}

.gv-success-message {
    background: #d1fae5;
    color: #059669;
}

.gv-info-message {
    background: #dbeafe;
    color: #1d4ed8;
}

.gv-closed-message {
    background: #fee2e2;
    color: #dc2626;
}

.gv-login-prompt {
    text-align: center;
    padding: 20px;
}

.gv-login-prompt svg {
    width: 48px;
    height: 48px;
    color: var(--gv-primary);
    margin-bottom: 12px;
}

/* ==========================================================================
   PROPIEDADES
   ========================================================================== */

.gv-property-card {
    background: var(--gv-bg-card);
    border-radius: var(--gv-radius);
    overflow: hidden;
    box-shadow: var(--gv-shadow);
    transition: var(--gv-transition);
}

.gv-property-card:hover {
    box-shadow: var(--gv-shadow-lg);
}

.gv-property-image {
    position: relative;
    height: 180px;
    background: var(--gv-bg);
    overflow: hidden;
}

.gv-property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gv-property-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--gv-primary);
    color: white;
}

.gv-property-badge.rent { background: var(--gv-info); }
.gv-property-badge.sale { background: var(--gv-success); }
.gv-property-badge.booking { background: var(--gv-warning); }

.gv-property-body {
    padding: 16px;
}

.gv-property-type {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gv-text-muted);
    margin-bottom: 4px;
}

.gv-property-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.gv-property-title a {
    color: var(--gv-text);
    text-decoration: none;
}

.gv-property-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--gv-text-muted);
    margin-bottom: 12px;
}

.gv-property-features {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--gv-text-muted);
    margin-bottom: 12px;
}

.gv-property-feature {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gv-property-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gv-primary);
}

.gv-property-price small {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--gv-text-muted);
}

.gv-property-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gv-border);
}

.gv-property-actions .gv-btn {
    flex: 1;
}

/* ==========================================================================
   DETALLE DE PROPIEDAD
   ========================================================================== */

.gv-property-single {
    padding-bottom: 100px;
}

.gv-property-gallery {
    position: relative;
    height: 280px;
    background: var(--gv-bg);
}

.gv-property-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gv-property-main-info {
    background: var(--gv-bg-card);
    padding: 20px 16px;
}

.gv-property-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.gv-property-big-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gv-primary);
}

.gv-property-contact-section {
    background: var(--gv-bg-card);
    margin: 16px;
    padding: 20px;
    border-radius: var(--gv-radius);
}

.gv-contact-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.gv-contact-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gv-whatsapp-btn {
    background: var(--whatsapp-green);
    color: white;
}

.gv-whatsapp-btn:hover {
    background: #20bd5a;
    color: white;
}

.gv-whatsapp-btn svg {
    width: 20px;
    height: 20px;
}

.gv-vendor-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--gv-bg);
    border-radius: var(--gv-radius-sm);
    margin-bottom: 16px;
}

.gv-vendor-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gv-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.25rem;
}

.gv-vendor-details h4 {
    margin: 0;
    font-size: 1rem;
}

.gv-vendor-details span {
    font-size: 0.85rem;
    color: var(--gv-text-muted);
}

/* ==========================================================================
   LISTAS (Mis empleos, Solicitudes)
   ========================================================================== */

.gv-jobs-list,
.gv-applications-list {
    padding: 16px;
}

.gv-job-list-item,
.gv-application-card,
.gv-my-application-card {
    background: var(--gv-bg-card);
    border-radius: var(--gv-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--gv-shadow);
}

.gv-job-list-main {
    margin-bottom: 12px;
}

.gv-job-list-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.gv-job-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--gv-text-muted);
}

.gv-job-list-stats {
    display: flex;
    gap: 20px;
    padding: 12px 0;
    border-top: 1px solid var(--gv-border);
    border-bottom: 1px solid var(--gv-border);
    margin-bottom: 12px;
}

.gv-stat {
    text-align: center;
}

.gv-stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gv-primary);
}

.gv-stat-label {
    font-size: 0.75rem;
    color: var(--gv-text-muted);
}

.gv-job-list-actions {
    display: flex;
    gap: 8px;
}

/* Application Card */
.gv-application-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.gv-applicant-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gv-applicant-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gv-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.gv-applicant-name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.gv-applicant-email {
    font-size: 0.85rem;
    color: var(--gv-text-muted);
}

.gv-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.gv-status-pending { background: #fef3c7; color: #d97706; }
.gv-status-reviewed { background: #dbeafe; color: #1d4ed8; }
.gv-status-shortlisted { background: #d1fae5; color: #059669; }
.gv-status-rejected { background: #fee2e2; color: #dc2626; }
.gv-status-hired { background: #059669; color: white; }

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.gv-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.gv-empty-state svg {
    margin-bottom: 16px;
}

.gv-empty-state h3 {
    font-size: 1.1rem;
    margin: 0 0 8px 0;
}

.gv-empty-state p {
    color: var(--gv-text-muted);
    margin: 0 0 20px 0;
}

/* ==========================================================================
   TOASTS Y NOTIFICACIONES
   ========================================================================== */

.gv-success-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #d1fae5;
    color: #059669;
    padding: 14px 16px;
    border-radius: var(--gv-radius);
    margin: 0 16px 16px;
    font-weight: 500;
}

.gv-success-toast svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ==========================================================================
   BADGES
   ========================================================================== */

.gv-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--gv-bg);
}

.gv-badge-open { background: #d1fae5; color: #059669; }
.gv-badge-closed { background: #fee2e2; color: #dc2626; }
.gv-badge-filled { background: #e0e7ff; color: #4f46e5; }

/* ==========================================================================
   NAV BAR INFERIOR (App Style)
   ========================================================================== */

.gv-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--gv-bottom-nav-height);
    background: var(--gv-bg-card);
    border-top: 1px solid var(--gv-border);
    display: flex;
    justify-content: center;
    z-index: 1000;
}

.gv-bottom-nav-inner {
    display: flex;
    max-width: var(--gv-max-width);
    width: 100%;
}

.gv-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    color: var(--gv-text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    transition: var(--gv-transition);
}

.gv-nav-item svg {
    width: 22px;
    height: 22px;
}

.gv-nav-item.active,
.gv-nav-item:hover {
    color: var(--gv-primary);
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 359px) {
    .gv-page-title {
        font-size: 1.25rem;
    }
    
    .gv-property-gallery {
        height: 220px;
    }
    
    .gv-property-big-price {
        font-size: 1.5rem;
    }
}

/* Safe area para dispositivos con notch */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .gv-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(var(--gv-bottom-nav-height) + env(safe-area-inset-bottom));
    }
    
    .gv-apply-section {
        bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

/* ==========================================================================
   UTILIDADES
   ========================================================================== */

.gv-text-center { text-align: center; }
.gv-text-muted { color: var(--gv-text-muted); }
.gv-mb-0 { margin-bottom: 0; }
.gv-mb-1 { margin-bottom: 8px; }
.gv-mb-2 { margin-bottom: 16px; }
.gv-mt-2 { margin-top: 16px; }

.gv-hidden { display: none !important; }

/* Animaciones */
@keyframes gv-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.gv-animate-in {
    animation: gv-fade-in 0.3s ease;
}

/* Loading state */
.gv-loading {
    opacity: 0.6;
    pointer-events: none;
}

.gv-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gv-border);
    border-top-color: var(--gv-primary);
    border-radius: 50%;
    animation: gv-spin 0.8s linear infinite;
}

@keyframes gv-spin {
    to { transform: rotate(360deg); }
}