/* TargetRadar Bloomberg Terminal Theme */

/* Typography - Helvetica Neue */
body {
    font-family: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

/* TargetRadar Corporate Identity - Centralized Color Palette */
:root {
    /* Primary Brand Colors */
    --tr-primary-bg: #0f0f0f;          /* Main background - consistent across all pages */
    --tr-secondary-bg: #1a1a1a;        /* Cards, containers */
    --tr-card-bg: #1e293b;             /* Main card background - slate-800 equivalent */
    --tr-tertiary-bg: #2d2d2d;         /* Input fields, elevated elements */
    --tr-accent-bg: #404040;           /* Hover states, borders */
    
    /* Text Colors */
    --tr-text-primary: #ffffff;        /* Main text */
    --tr-text-secondary: #cccccc;      /* Secondary text */
    --tr-text-muted: #888888;          /* Placeholder, disabled text */
    
    /* Brand Colors */
    --tr-orange-primary: #ff8c00;      /* Primary orange - buttons, highlights */
    --tr-orange-hover: #ff8c00;        /* Orange hover state - same as primary */
    --tr-orange-glow: rgba(255, 140, 0, 0.3);  /* Orange glow effects */
    
    /* Status Colors */
    --tr-success: #10b981;
    --tr-warning: #f59e0b;
    --tr-error: #ef4444;
    
    /* Legacy aliases for backward compatibility */
    --bloomberg-black: var(--tr-primary-bg);
    --bloomberg-dark-gray: var(--tr-secondary-bg);
    --bloomberg-gray: var(--tr-tertiary-bg);
    --bloomberg-light-gray: var(--tr-accent-bg);
    --bloomberg-text: var(--tr-text-primary);
    --bloomberg-orange: var(--tr-orange-primary);
    --muted-silver: var(--tr-text-muted);
}

/* Centralized card background class */
.tr-card-bg { 
    background-color: var(--tr-card-bg) !important; 
}

/* Override Tailwind slate colors to use our centralized color */
.bg-slate-700 { 
    background-color: var(--tr-card-bg) !important; 
}

.bg-slate-800 { 
    background-color: var(--tr-card-bg) !important; 
}

.bg-slate-900 { 
    background-color: var(--tr-card-bg) !important; 
}

.bg-slate-750 { 
    background-color: #1e2532 !important; 
}

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

/* Sort Button Styles */
.sort-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: rgba(30, 41, 59, 0.5);
    color: #94a3b8;
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    min-width: 120px;
    height: 44px;
    white-space: nowrap;
    gap: 4px;
}

.sort-btn:hover {
    background: rgba(30, 41, 59, 0.8);
    color: #cbd5e1;
    border-color: rgba(255, 140, 0, 0.5);
    transform: translateY(-2px);
}

.sort-btn.active {
    background: #ff8c00;
    color: white;
    border-color: #ff8c00;
    transform: none;
}

.sort-btn.active:hover {
    background: #ff9500;
    transform: translateY(-2px);
}

/* Compact Sort Button Styles */
.sort-btn-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background-color: transparent;
    color: var(--tr-text-muted);
    border: 1px solid var(--tr-accent-bg);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    min-width: 90px;
    height: 32px;
    text-align: center;
    white-space: nowrap;
    gap: 4px;
}

.sort-btn-compact:hover {
    background-color: var(--tr-secondary-bg);
    color: var(--tr-text-secondary);
    border-color: var(--tr-orange-primary);
}

.sort-btn-compact.active {
    background-color: var(--tr-orange-primary);
    color: white;
    border-color: var(--tr-orange-primary);
}

.sort-btn-compact.active:hover {
    background-color: var(--tr-orange-hover);
}

/* Centralized Body Styles - Corporate Identity */
body {
    background-color: var(--tr-primary-bg);
    color: var(--tr-text-primary);
    min-height: 100vh;
}

/* Centralized Layout Classes */
.tr-body-search,
.tr-body-explore,
.tr-body-bookmarks,
.tr-body-alerts {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #0f172a;
}

.tr-body-auth {
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem !important;
}

.tr-main-container {
    min-height: 100vh;
    background: transparent;
}

.tr-search-container {
    padding: 1.5rem 0;
    border-top: 1px solid #374151;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
}

/* Listing/Result Cards Hover Effect */
.listing-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.listing-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
}

/* Toggle Switch */
input[type="checkbox"]:checked + .toggle-switch {
    background-color: #ff8c00 !important;
}

input[type="checkbox"]:checked + .toggle-switch .toggle-circle {
    transform: translateX(28px) !important;
}

/* Centralized Icon Management */
.fas, .far, .fab, i[class*="fa-"] {
    color: var(--tr-text-muted);
    transition: color 0.2s ease;
}

/* Override for saved bookmark icons - HIGHER SPECIFICITY */
.save-listing-btn.text-orange-500 .fas,
.save-listing-btn.text-orange-500 .far,
.save-listing-btn.text-orange-500 .fab,
.save-listing-btn.text-orange-500 i[class*="fa-"],
.modal-bookmark-btn.text-orange-500 .fas,
.modal-bookmark-btn.text-orange-500 .far,
.modal-bookmark-btn.text-orange-500 .fab,
.modal-bookmark-btn.text-orange-500 i[class*="fa-"] {
    color: var(--tr-orange-primary) !important;
    transition: none !important;
}

/* Modal bookmark SVG - filled when saved */
.modal-bookmark-btn.text-orange-500 svg {
    fill: var(--tr-orange-primary) !important;
    stroke: none !important;
    color: var(--tr-orange-primary) !important;
}

/* Modal bookmark SVG - unfilled when not saved */
.modal-bookmark-btn.text-gray-400 svg {
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
}

/* Modal header buttons - consistent styling for both bookmark and close buttons */
.modal-bookmark-btn,
.modal-close {
    background: none;
    border: none;
    cursor: pointer;
}

.modal-bookmark-btn:hover,
.modal-close:hover {
    color: var(--tr-orange-primary) !important;
    transform: scale(1.1);
}

/* Saved state - orange icon only */
.modal-bookmark-btn.text-orange-500 {
    color: var(--tr-orange-primary) !important;
    background: none !important;
}

.modal-bookmark-btn.text-orange-500:hover {
    transform: scale(1.1);
}

.modal-bookmark-btn.text-orange-500 i {
    color: var(--tr-orange-primary) !important;
}

/* Tooltip text styling */
.modal-bookmark-btn span {
    color: white !important;
}

/* Interactive icons */
.fas:hover, .far:hover, .fab:hover, 
i[class*="fa-"]:hover {
    color: var(--tr-orange-primary);
}

/* Specific icon contexts */
.auth-input + button .fas {
    color: var(--tr-text-muted);
}

/* Search container icons - but NOT search button */
.search-container .fas:not(.tr-search-button .fas) {
    color: var(--tr-text-muted);
}

.auth-input:focus + button .fas,
.search-input-enhanced:focus + .fas {
    color: var(--tr-orange-primary);
}

/* Interactive icon class */
.tr-icon-interactive {
    color: var(--tr-text-muted);
    transition: color 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
}

.tr-icon-interactive:hover {
    color: var(--tr-orange-primary);
}

.tr-icon-interactive .fas,
.tr-icon-interactive .far,
.tr-icon-interactive .fab {
    color: inherit;
}

/* Centralized Logo Styling - Unified Across All Auth Pages */
.tr-logo-container {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 80px !important;
    height: 80px !important;
    border-radius: 50% !important;
    background: var(--tr-primary-bg) !important;
    margin: 0 auto 1.5rem auto !important;
}

.tr-logo-svg {
    width: 48px !important;
    height: 48px !important;
    color: var(--tr-orange-primary) !important;
}

/* Unified Auth Container */
.tr-auth-container {
    background: var(--tr-card-bg) !important;
    border: 1px solid #475569 !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3) !important;
    padding: 2rem !important;
    width: 100% !important;
    max-width: 32rem !important; /* 512px - consistent size */
    min-height: 600px !important; /* Ensure consistent height for both login and request access */
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

/* Hide reCAPTCHA badge (disclosure text required on pages) */
.grecaptcha-badge {
    visibility: hidden !important;
}

/* Unified Auth Header */
.tr-auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tr-auth-title {
    font-size: 2.25rem;
    font-weight: bold;
    color: var(--tr-text-primary);
    margin-bottom: 0.75rem;
}

.tr-auth-subtitle {
    font-size: 1.125rem;
    color: var(--tr-text-secondary);
    margin-bottom: 0.5rem;
}

.tr-auth-description {
    color: var(--tr-text-muted);
}

/* Buttons */
.btn-bloomberg {
    background-color: var(--bloomberg-orange);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: "Helvetica Neue", sans-serif;
}

.btn-bloomberg:hover {
    background-color: var(--tr-orange-primary);
    transform: translateY(-1px);
}

.btn-bloomberg:disabled {
    background-color: var(--muted-silver);
    cursor: not-allowed;
    transform: none;
}

/* Form Elements */
.form-input {
    background: transparent;
    border: 1px solid var(--tr-orange-primary);
    color: var(--bloomberg-text);
    padding: 0.75rem 1rem;
    border-radius: 24px;
    font-family: "Helvetica Neue", sans-serif;
    width: 100%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:hover {
    background: var(--tr-secondary-bg);
    border-color: var(--tr-orange-primary);
}

.form-input:focus {
    outline: none;
    background: var(--tr-secondary-bg);
    border-color: var(--tr-orange-primary);
    box-shadow: 0 0 0 1px var(--tr-orange-primary);
}

.form-label {
    color: var(--bloomberg-text);
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

/* Cards */
.bloomberg-card {
    background-color: var(--bloomberg-gray);
    border: 1px solid var(--bloomberg-light-gray);
    border-radius: 8px;
    padding: 1.5rem;
}

/* Status Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-new {
    background-color: var(--bloomberg-orange);
    color: var(--bloomberg-black);
}

.badge-approved {
    background-color: var(--success-green);
    color: var(--bloomberg-black);
}

.badge-rejected {
    background-color: var(--error-red);
    color: var(--bloomberg-text);
}

.badge-reviewed {
    background-color: var(--warning-yellow);
    color: var(--bloomberg-black);
}

/* Loading States */
.loading-spinner {
    border: 2px solid var(--bloomberg-light-gray);
    border-top: 2px solid var(--bloomberg-orange);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* Legacy auth-container - DEPRECATED, use .tr-auth-container instead */

.auth-input {
    background: var(--bloomberg-gray);
    border: 1px solid var(--bloomberg-light-gray);
    color: var(--bloomberg-text);
    transition: all 0.3s ease;
}

.auth-input::placeholder {
    color: var(--muted-silver);
}

.auth-input:focus {
    background: #333333;
    border-color: var(--bloomberg-orange);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
    outline: none;
}

.auth-btn {
    background: var(--tr-orange-primary);
    transition: all 0.3s ease;
    border: none;
    color: #000000;
    font-weight: 600;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 140, 0, 0.3);
}

/* Reddit-Style Search Box - Corporate Identity */
.search-container {
    position: relative;
    overflow: visible;
}

.search-input-enhanced {
    position: relative;
    border: 1px solid var(--tr-orange-primary);
    background: transparent;
    color: var(--tr-text-primary);
    border-radius: 24px;
    padding: 12px 60px 12px 48px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    font-size: 16px;
    height: 48px;
    width: 100%;
}

/* Reddit-style glow effect */
.search-input-enhanced::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: var(--tr-orange-primary);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.search-input-enhanced:focus {
    background: var(--tr-secondary-bg);
    border-color: var(--tr-orange-primary);
    outline: none;
    box-shadow: 0 0 0 1px var(--tr-orange-primary);
}

.search-input-enhanced:focus::before {
    opacity: 0.1;
}

.search-input-enhanced:hover:not(:focus) {
    background: var(--tr-secondary-bg);
    border-color: var(--tr-orange-hover);
}

/* Search icon positioning */
.search-container .fas.fa-search {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tr-text-muted);
    z-index: 10;
    pointer-events: none;
}

/* Search button styling */
.tr-search-button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--tr-orange-primary);
    color: #000000;
    border: none;
    border-radius: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.tr-search-button:hover {
    background: var(--tr-orange-hover);
    transform: translateY(-50%) scale(1.05);
}

.tr-search-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: translateY(-50%) scale(1);
}

.tr-search-button .fas {
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    /* Fine-tuned centering */
    margin-left: -1.5px;
    margin-top: -1px;
    line-height: 1;
}

/* Override any conflicting icon styles specifically for search button */
button.tr-search-button i.fas.fa-search {
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    /* Fine-tuned centering */
    margin-left: -1.5px;
    margin-top: -1px;
    line-height: 1;
}

/* Rotating placeholder text animation */
.rotating-placeholder {
    position: relative;
    overflow: hidden;
}

.placeholder-text {
    position: absolute;
    top: 50%;
    left: 48px;
    transform: translateY(-50%);
    color: var(--tr-text-muted);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    font-size: 16px;
    white-space: nowrap;
    z-index: 10;
    cursor: pointer;
}

.placeholder-text.active {
    opacity: 1;
    animation: fadeInSlide 0.5s ease-out;
}

.placeholder-text:hover {
    color: var(--tr-orange-primary);
    opacity: 1 !important;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.search-input-enhanced:focus + .placeholder-container .placeholder-text,
.search-input-enhanced:not([value=""]) + .placeholder-container .placeholder-text {
    opacity: 0;
}

/* Glass Morphism (for login/forms) */
.glass {
    background: rgba(42, 42, 42, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

/* Modal Styles */
.modal-overlay {
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bloomberg-gray);
    border: 1px solid var(--bloomberg-light-gray);
    border-radius: 12px;
    max-height: 90vh;
    overflow-y: auto;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--muted-silver);
}

/* Listing Cards */
.listing-card {
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.listing-card.animate-slide-in-up {
    animation: slideInUp 0.6s ease-out forwards;
}

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

.listing-card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--tr-orange-primary);
}

/* Score badge colors - 5-tier attractiveness system */
.text-exceptional-green { color: #10b981; }
.border-exceptional-green { border-color: #10b981; }
.text-strong-green { color: #22c55e; }
.border-strong-green { border-color: #22c55e; }
.text-moderate-yellow { color: #eab308; }
.border-moderate-yellow { border-color: #eab308; }
.text-limited-orange { color: #f97316; }
.border-limited-orange { border-color: #f97316; }
.text-distressed-red { color: #ef4444; }
.border-distressed-red { border-color: #ef4444; }

/* Tooltip styles for UI components */
.badge-tooltip:hover .tooltip,
.opportunity-score-badge:hover .tooltip {
    opacity: 1;
    pointer-events: auto;
}

/* Hover effects for listing cards */
.listing-card-interactive:hover {
    border-color: var(--tr-orange-primary) !important;
    box-shadow: 0 10px 25px -3px var(--tr-orange-glow), 0 4px 6px -2px var(--tr-orange-glow) !important;
    transform: translateY(-1px);
}

.listing-card {
    transition: all 0.2s ease-in-out;
}

/* Utility Classes */
.text-bloomberg-orange { color: var(--bloomberg-orange); }
.text-bloomberg-text { color: var(--bloomberg-text); }
.text-muted-silver { color: var(--muted-silver); }
.bg-bloomberg-black { background-color: var(--bloomberg-black); }

/* Override Tailwind orange classes to use our standard orange */
.bg-orange-500, .bg-orange-600 {
    background-color: var(--tr-orange-primary) !important;
}

.hover\:bg-orange-600:hover, .hover\:bg-orange-700:hover {
    background-color: var(--tr-orange-primary) !important;
}

.text-orange-400, .text-orange-500 {
    color: var(--tr-orange-primary) !important;
}

.hover\:text-orange-300:hover {
    color: var(--tr-orange-primary) !important;
}

.focus\:ring-orange-500:focus {
    --tw-ring-color: var(--tr-orange-primary) !important;
}

.focus\:border-orange-500:focus {
    border-color: var(--tr-orange-primary) !important;
}
.bg-bloomberg-gray { background-color: var(--bloomberg-gray); }
.bg-bloomberg-light-gray { background-color: var(--bloomberg-light-gray); }
.border-bloomberg-light-gray { border-color: var(--bloomberg-light-gray); }

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    .btn-bloomberg {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}
