/* Shared CSS for all pages */
body {
    font-family: 'Inter', sans-serif;
}

/* Common gradients and backgrounds */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Loader animations */
.loader {
    border-top-color: #3498db;
    -webkit-animation: spinner 1.5s linear infinite;
    animation: spinner 1.5s linear infinite;
}

@-webkit-keyframes spinner {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}

@keyframes spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tier badges */
.tier-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tier-trainee {
    background: #fef3c7;
    color: #92400e;
}

.tier-junior {
    background: #dbeafe;
    color: #1e40af;
}

.tier-senior {
    background: #d1fae5;
    color: #065f46;
}

.tier-manager {
    background: #f3e8ff;
    color: #7c3aed;
}

/* Performance badges */
.performance-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.performance-excellent {
    background: #d1fae5;
    color: #065f46;
}

.performance-good {
    background: #dbeafe;
    color: #1e40af;
}

.performance-average {
    background: #fef3c7;
    color: #92400e;
}

.performance-poor {
    background: #fee2e2;
    color: #991b1b;
}

/* Stats cards - Now using Tailwind classes */

.stats-card h3 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.stats-card .value {
    color: white;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stats-card .text-sm {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.5rem;
}

.stats-card .opacity-90 {
    opacity: 0.9;
}

.stats-card .mt-2 {
    margin-top: 0.5rem;
}

/* Card content improvements */
.salesperson-card h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.salesperson-card .text-2xl {
    font-size: 1.5rem;
    font-weight: 800;
    color: #059669;
}

.salesperson-card .text-sm {
    font-size: 0.875rem;
    color: #6b7280;
}

.salesperson-card .space-y-3 > * + * {
    margin-top: 0.75rem;
}

.goal-card h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.goal-card .text-2xl {
    font-size: 1.5rem;
    font-weight: 800;
    color: #3b82f6;
}

.goal-card .text-sm {
    font-size: 0.875rem;
    color: #6b7280;
}

.goal-card .space-y-3 > * + * {
    margin-top: 0.75rem;
}

/* Tables - Now using Tailwind classes */

.total-row {
    background: #f0f9ff !important;
    font-weight: 600;
    border-top: 2px solid #3b82f6;
}

.table-row {
    transition: all 0.2s ease;
}

.table-row:hover {
    background: #f9fafb;
}

/* Currency formatting */
.currency {
    font-variant-numeric: tabular-nums;
}

/* Action buttons */
.action-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

/* Table headers */
.table-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
    font-weight: 600;
    text-align: center;
}

/* Form elements */
.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background-color: white;
    transition: border-color 0.2s ease;
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Input field (alias for form-input) */
.input-field {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
    background-color: white;
}

.input-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #374151;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Button styles */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid #d1d5db;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.btn-danger {
    background: #ef4444;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-edit {
    background: #3b82f6;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-edit:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-delete {
    background: #ef4444;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Success/Error messages */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Loading states */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive utilities */
@media (max-width: 640px) {
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .stats-card {
        padding: 1rem;
    }
    
    .stats-card .value {
        font-size: 1.5rem;
    }
}

/* Chart container */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Tab styles */
.tab-container {
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.tab-list {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-button:hover {
    color: #374151;
    background: #f9fafb;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f8fafc;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Export buttons - Now using Tailwind classes */

/* Data tables - Now using Tailwind classes */

/* Salesperson cards */
.salesperson-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Removed top border gradient for cleaner look */
/* .salesperson-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
} */

.salesperson-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

/* Goal indicators */
.goal-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.goal-achieved {
    background: #d1fae5;
    color: #065f46;
}

.goal-good {
    background: #dbeafe;
    color: #1e40af;
}

.goal-average {
    background: #fef3c7;
    color: #92400e;
}

.goal-poor {
    background: #fee2e2;
    color: #991b1b;
}

/* Goal progress bars */
.goal-progress {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.goal-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.goal-progress-achieved {
    background: linear-gradient(90deg, #10b981, #059669);
}

.goal-progress-good {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

.goal-progress-average {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.goal-progress-poor {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* Goal cards - Now using Tailwind classes */

.goal-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.goal-metric-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.goal-metric-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.goal-missing {
    color: #ef4444;
    font-weight: 600;
}

.goal-exceeded {
    color: #10b981;
    font-weight: 600;
}

/* Tab navigation */
.tab-navigation {
    background: white;
    border-radius: 1rem;
    padding: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    margin-bottom: 2rem;
}

.tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tab-item {
    flex: 1;
    min-width: 0;
}

.tab-button {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
}

.tab-button:hover {
    background: #f3f4f6;
    color: #374151;
}

.tab-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* fadeIn animation - Now using Tailwind classes */

.tab-icon {
    font-size: 1rem;
}

/* Form sections - Now using Tailwind classes */

/* Custom emoji animations */
.emoji-hover {
    transition: all 0.3s ease;
}

.emoji-hover:hover {
    transform: scale(1.2) rotate(5deg);
}

.emoji-checked {
    animation: emojiPop 0.6s ease-out;
}

@keyframes emojiPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) rotate(10deg); }
    100% { transform: scale(1); }
}

/* Tooltips */
.tooltip {
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/* Cards - Now using Tailwind classes */

/* Goal icons */
.goal-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.goal-icon:hover {
    transform: scale(1.05);
}

.goal-completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.goal-partial {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.goal-missed {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.goal-empty {
    background: #f9fafb;
    color: #9ca3af;
    border: 2px dashed #d1d5db;
}

.goal-empty:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Metric badges */
.metric-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0.125rem;
    transition: all 0.2s ease;
}

.metric-badge:hover {
    transform: translateY(-1px);
}

.metric-discadas { background: #dbeafe; color: #1e40af; }
.metric-faladas { background: #dcfce7; color: #166534; }
.metric-whatsapp { background: #f3e8ff; color: #7c3aed; }
.metric-leads { background: #fef2f2; color: #dc2626; }
.metric-indicacoes { background: #e0e7ff; color: #3730a3; }

/* Week navigation buttons */
.week-nav-btn {
    transition: all 0.2s ease;
}

.week-nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Progress rings */
.progress-ring {
    transition: stroke-dasharray 0.5s ease;
}

/* Salesperson cards - Now using Tailwind classes */

/* Header dropdown */
.dropdown {
    display: none !important;
}

.dropdown.show {
    display: block !important;
}

.nav-link {
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Ensure dropdown is properly positioned */
#avatarDropdown {
    display: none !important;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
}

#avatarDropdown.show {
    display: block !important;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .modal-overlay {
        position: static;
        background: none;
    }
    
    .modal-content {
        box-shadow: none;
        border: 1px solid #000;
    }
}

@media (max-width: 768px) {
    .tab-list {
        flex-direction: column;
    }
    
    .tab-button {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
}
