/**
 * PetSabe - Estilos Principais
 * Baseado na identidade visual laranja/coral
 */

:root {
    --primary: #F5841F;
    --primary-dark: #D6701A;
    --primary-light: #FFB366;
    --secondary: #3D2D1F;
    --secondary-light: #5D4D3F;
    --accent: #FF6B35;
    --success: #28A745;
    --danger: #DC3545;
    --warning: #FFC107;
    --info: #17A2B8;
    --light: #FFF8F0;
    --dark: #2D2015;
    --white: #FFFFFF;
    --gray-100: #F8F9FA;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-500: #ADB5BD;
    --gray-600: #6C757D;
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    --gradient-warm: linear-gradient(135deg, #FFE4C4 0%, #FFDAB9 100%);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-primary: 0 4px 14px rgba(245, 132, 31, 0.35);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--light);
    color: var(--secondary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.text-primary { color: var(--primary) !important; }
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Buttons */
.btn {
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 132, 31, 0.45);
    background: var(--gradient-primary);
    color: var(--white);
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

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

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1.1rem;
    border-radius: var(--radius-md);
}

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    background: var(--white);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.card-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.card-icon.primary {
    background: rgba(245, 132, 31, 0.1);
    color: var(--primary);
}

.card-icon.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.card-icon.info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info);
}

/* Forms */
.form-control, .form-select {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 132, 31, 0.15);
}

.form-label {
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.input-group-text {
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
}

.form-floating > .form-control,
.form-floating > .form-select {
    height: calc(3.5rem + 4px);
    padding: 1rem;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--gray-500);
    z-index: 5;
}

.password-toggle:hover {
    color: var(--primary);
}

.input-icon-wrapper {
    position: relative;
}

/* Navbar */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 0;
}

.navbar-brand img {
    height: 45px;
    transition: var(--transition);
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 600;
    color: var(--secondary) !important;
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
    border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary) !important;
    background: rgba(245, 132, 31, 0.08);
}

/* Sidebar */
.sidebar {
    background: var(--white);
    min-height: calc(100vh - 70px);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.5rem;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-link i {
    font-size: 1.2rem;
    margin-right: 0.75rem;
    width: 24px;
    text-align: center;
}

.sidebar-link:hover {
    background: rgba(245, 132, 31, 0.08);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-link.active {
    background: rgba(245, 132, 31, 0.12);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

/* Tables */
.table {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table thead th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--secondary);
    border-bottom: 2px solid var(--gray-200);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: rgba(245, 132, 31, 0.04);
}

/* Badges */
.badge {
    font-weight: 600;
    padding: 0.5em 0.85em;
    border-radius: var(--radius-sm);
}

.badge-primary {
    background: rgba(245, 132, 31, 0.15);
    color: var(--primary);
}

.badge-success {
    background: rgba(40, 167, 69, 0.15);
    color: var(--success);
}

.badge-danger {
    background: rgba(220, 53, 69, 0.15);
    color: var(--danger);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.25);
    color: #856404;
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(40, 167, 69, 0.12);
    color: #155724;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.12);
    color: #721c24;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
}

.alert-info {
    background: rgba(23, 162, 184, 0.12);
    color: #0c5460;
}

/* Stats Cards */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-card p {
    color: var(--gray-600);
    margin: 0;
    font-size: 0.9rem;
}

/* Hero Section */
.hero {
    background: var(--gradient-warm);
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: var(--primary);
    opacity: 0.08;
    border-radius: 50%;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--secondary-light);
    margin-bottom: 2rem;
}

/* Pet Card */
.pet-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.pet-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.pet-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
}

.pet-card-qr {
    position: absolute;
    bottom: -30px;
    right: 20px;
    background: var(--white);
    padding: 8px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.pet-card-qr img {
    width: 60px;
    height: 60px;
}

/* QR Code Display */
.qr-display {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.qr-display img {
    max-width: 200px;
    margin-bottom: 1rem;
}

.qr-code-text {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--secondary);
    background: var(--gray-100);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* Location Card */
.location-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.location-card h5 {
    color: var(--white);
}

.location-card .bi {
    font-size: 2rem;
    opacity: 0.9;
}

/* Tag Types */
.tag-option {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.tag-option:hover {
    border-color: var(--primary-light);
    background: rgba(245, 132, 31, 0.04);
}

.tag-option.selected {
    border-color: var(--primary);
    background: rgba(245, 132, 31, 0.08);
}

.tag-option img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

.tag-option h6 {
    margin-bottom: 0.25rem;
}

.tag-option .price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* Public Find Page */
.find-page {
    min-height: 100vh;
    background: var(--gradient-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.find-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    overflow: hidden;
}

.find-card-header {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 2rem;
    text-align: center;
}

.find-card-header img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--white);
    object-fit: cover;
    margin-bottom: 1rem;
}

.find-card-body {
    padding: 2rem;
}

/* Loading */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--white);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

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

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: var(--transition);
}

.page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

.slide-up {
    animation: slideUp 0.4s ease;
}

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

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 70px;
        left: -280px;
        width: 280px;
        z-index: 1000;
        transition: var(--transition);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar-backdrop {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-backdrop.show {
        display: block;
    }
    
    .hero-title {
        font-size: 2rem;
    }
}

@media (max-width: 575.98px) {
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* Utilities */
.bg-gradient-primary {
    background: var(--gradient-primary) !important;
}

.bg-gradient-warm {
    background: var(--gradient-warm) !important;
}

.rounded-lg {
    border-radius: var(--radius-lg) !important;
}

.rounded-xl {
    border-radius: var(--radius-xl) !important;
}

.shadow-primary {
    box-shadow: var(--shadow-primary) !important;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

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

/* Custom Select */
.custom-select-img {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.custom-select-img img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.empty-state h5 {
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}
