/* ============================================================
   Subastas Paraguay - Main Stylesheet
   ============================================================ */

/* CSS Custom Properties */
:root {
    --primary: #0d9488;
    --primary-hover: #0f766e;
    --primary-light: #ccfbf1;
    --secondary: #f472b6;
    --secondary-hover: #ec4899;
    --accent: #f59e0b;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --info: #3b82f6;

    --bg: #f8fafc;
    --bg-alt: #ffffff;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;

    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border: #e2e8f0;
    --border-focus: #0d9488;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --transition: 150ms ease;
}

/* Reset & Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.2; color: var(--text); }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
p { color: var(--text-secondary); }

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    border-radius: var(--radius);
    transition: all var(--transition);
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--surface-hover);
    border-color: var(--primary);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.875rem; }
.btn-lg { padding: 0.875rem 1.5rem; font-size: 1.0625rem; }
.btn-xl { padding: 1rem 2rem; font-size: 1.125rem; }

/* Form Elements */
.form-control, .form-select {
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder { color: var(--text-muted); }

.input-group { display: flex; }
.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 1rem;
}
.input-group .form-control { border-left: none; border-radius: 0 var(--radius) var(--radius) 0; }
.input-group .input-group-text:first-child { border-radius: var(--radius) 0 0 var(--radius); border-right: none; }

.form-label { display: block; margin-bottom: 0.375rem; font-weight: 500; color: var(--text); }
.form-text { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header { padding: 1.25rem; border-bottom: 1px solid var(--border); background: var(--bg); }
.card-body { padding: 1.25rem; }
.card-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); background: var(--bg); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-secondary { background: #fce7f3; color: var(--secondary); }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
}
.alert-dismissible { padding-right: 3rem; }
.alert-primary { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.alert-success { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
.alert-danger { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.alert-info { background: #dbeafe; border-color: #bfdbfe; color: #1e40af; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.875rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; color: var(--text-secondary); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.05em; background: var(--bg); }
.table tbody tr:hover { background: var(--bg); }

/* Dropdowns */
.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}
.dropdown-item {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: all var(--transition);
}
.dropdown-item:hover { background: var(--bg); color: var(--primary); }
.dropdown-divider { border-color: var(--border); margin: 0.5rem 0; }
.dropdown-header { padding: 0.5rem 1rem; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }

/* Pagination */
.pagination { gap: 0.25rem; }
.page-link {
    padding: 0.5rem 0.875rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
}
.page-link:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-item.disabled .page-link { opacity: 0.5; pointer-events: none; }

/* Modal */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); }

/* Toasts */
.toast-container { z-index: 1080; }
.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem;
}
.toast-header { border-bottom: 1px solid var(--border); }
.toast-body { color: var(--text); }

/* Spinner */
.spinner-border { width: 1.5rem; height: 1.5rem; border-width: 0.15em; color: var(--primary); }
.spinner-border-sm { width: 1rem; height: 1rem; border-width: 0.12em; }

/* Avatar */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.875rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.25rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 1.75rem; }

/* Auction Card */
.auction-card {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
    overflow: hidden;
}
.auction-card:hover { text-decoration: none; }
.auction-card-img {
    aspect-ratio: 4/3;
    width: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.auction-card:hover .auction-card-img { transform: scale(1.03); }
.auction-card-badge { z-index: 1; }
.auction-card-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.auction-card-price { font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.auction-card-meta { font-size: 0.8125rem; }

/* Time left */
.time-left { font-variant-numeric: tabular-nums; }
.time-left.urgent { color: var(--danger); animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Favorite button */
.fav-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    transition: all var(--transition);
}
.fav-btn:hover { background: #fff; transform: scale(1.1); }
.fav-btn.active i { color: var(--danger); }
.fav-btn i { transition: color var(--transition); }

/* Hero geometric accents */
.hero-geo {
    position: relative;
    overflow: hidden;
}
.hero-geo::before,
.hero-geo::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
    pointer-events: none;
}
.hero-geo::before {
    width: 400px; height: 400px;
    top: -100px; right: -80px;
    background: rgba(244, 114, 182, 0.12);
}
.hero-geo::after {
    width: 320px; height: 320px;
    bottom: -100px; left: -60px;
    background: rgba(13, 148, 136, 0.1);
}
.hero-geo > .container { position: relative; z-index: 1; }

.geo-mark {
    display: inline-block;
    width: 14px; height: 14px;
    background: var(--primary);
    transform: rotate(45deg);
    vertical-align: middle;
    margin-right: 0.75rem;
}
.geo-mark.pink { background: var(--secondary); margin-left: 0.5rem; margin-right: 0; }

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up { animation: fadeInUp 0.5s ease forwards; }
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }

/* Price badge */
.price-badge {
    display: inline-flex;
    align-items: center;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text);
    padding-left: 0.75rem;
    border-left: 4px solid var(--primary);
}

/* Category tag */
.category-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg);
    color: var(--text-secondary);
    margin-right: 0.375rem;
    margin-bottom: 0.375rem;
    border-left: 3px solid var(--primary);
    transition: all var(--transition);
}
.category-tag:hover { background: var(--primary); color: #fff; }

/* Ending soon pulse */
.ending-soon {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--danger);
}
.ending-soon .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--danger);
    animation: pulse-dot 1.4s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.7); }
}

/* Responsive */
@media (max-width: 768px) {
    .btn-xl { padding: 0.875rem 1.5rem; font-size: 1rem; }
    .card-body { padding: 1rem; }
}

/* Print */
@media print {
    .no-print { display: none !important; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}