/**
 * Shared styles for partner portal
 * Use alongside Tailwind CSS
 */

/* Base styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Focus styles */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid #16a34a;
    outline-offset: 2px;
}

/* Card hover effects */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* Button loading state */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

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

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Slide in animation */
.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Pulse animation for notifications */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Progress bar */
.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #14b8a6);
    border-radius: 4px;
    transition: width 0.5s ease;
}

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

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: #1f2937;
    color: white;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 50;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-green {
    background-color: #dcfce7;
    color: #15803d;
}

.badge-teal {
    background-color: #ccfbf1;
    color: #0f766e;
}

.badge-yellow {
    background-color: #fef3c7;
    color: #b45309;
}

.badge-red {
    background-color: #fee2e2;
    color: #b91c1c;
}

.badge-gray {
    background-color: #f3f4f6;
    color: #4b5563;
}

/* Table styles */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

.data-table tr:hover {
    background: #f9fafb;
}

/* Form input focus ring */
.input-focus {
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-focus:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: 4px;
}

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

/* Chart container */
.chart-container {
    position: relative;
    height: 300px;
}

@media (max-width: 640px) {
    .chart-container {
        height: 250px;
    }
}

/* Responsive typography */
@media (max-width: 640px) {
    .text-responsive-xl {
        font-size: 1.5rem;
    }

    .text-responsive-2xl {
        font-size: 1.75rem;
    }

    .text-responsive-3xl {
        font-size: 2rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white;
    }

    .bg-white {
        box-shadow: none !important;
    }
}

/* ============================================
   Form Elements
   ============================================ */

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

.form-input:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

/* Form label */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* ============================================
   Button Styles
   ============================================ */

/* Base button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

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

/* Primary button - Green for partner portal */
.btn-primary {
    background-color: #16a34a;
    color: white;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    background-color: #15803d;
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.5);
}

/* Secondary button */
.btn-secondary {
    background-color: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #f9fafb;
}

/* Danger button */
.btn-danger {
    background-color: #dc2626;
    color: white;
    border: none;
}

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

/* Full width button */
.btn-full {
    width: 100%;
}

/* ============================================
   Modal Styles
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
    transition: opacity 0.2s ease-in-out;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 28rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(1);
    transition: all 0.2s ease-in-out;
}

.modal-hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-hidden .modal-content {
    transform: scale(0.95);
    opacity: 0;
}

/* ============================================
   Link Styles
   ============================================ */

.link {
    color: #16a34a;
    font-weight: 500;
    transition: color 0.2s;
}

.link:hover {
    color: #15803d;
    text-decoration: underline;
}

/* ============================================
   Divider with text
   ============================================ */

.divider-text {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.divider-text span {
    padding: 0 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* ============================================
   Partner-specific styles
   ============================================ */

/* Preference level badges */
.preference-recommended {
    background-color: #fee2e2;
    color: #991b1b;
}

.preference-preferred {
    background-color: #dcfce7;
    color: #166534;
}

.preference-supported {
    background-color: #fef3c7;
    color: #92400e;
}

.preference-optional {
    background-color: #dbeafe;
    color: #1e40af;
}
