/* Earnings Page Styles - Professional High-Tech Design */
/* Following user's preference for minimal, grey/black theme without blue */

/* CRITICAL: Force static positioning to prevent floating elements */
.earnings-breadcrumb,
.earnings-main-content,
#earnings-content {
    position: static !important;
    float: none !important;
    clear: both !important;
}

/* Global Layout Fixes - Ensure full black background */
body {
    background: #000000 !important;
    color: #ffffff !important;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

html {
    background: #000000 !important;
}

/* Ensure all main containers have black background */
.main-content-area,
.page-content,
main {
    background: #000000 !important;
}

/* Ensure all sections have consistent black background */
.earnings-breadcrumb,
.search-section,
.earnings-main-content,
#earnings-content {
    background: #000000 !important;
}

/* Professional Breadcrumb Navigation */
.earnings-breadcrumb {
    background: transparent;
    padding: 0.5rem 0;
    width: 100%;
    display: block;
}

.breadcrumb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.breadcrumb-link:hover {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.breadcrumb-icon {
    width: 1rem;
    height: 1rem;
}

.breadcrumb-separator {
    color: rgba(255, 255, 255, 0.3);
    width: 1rem;
    height: 1rem;
}

.breadcrumb-current .breadcrumb-text {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Centered Search Section */
.search-section {
    background: transparent;
    padding: 0.75rem 0;
    width: 100%;
    display: block;
}

.search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
}

#header-search-placeholder {
    width: 100%;
    max-width: 500px;
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
}

/* Update ticker search for centered positioning */
.search-section .ticker-search-container {
    max-width: 500px;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Page header styles now use global .page-header from base.css */

/* Main Content Area - SINGLE DEFINITION */
.earnings-main-content {
    background: transparent;
    min-height: 60vh;
    width: 100%;
    display: block;
    margin: 0;
    padding: 0;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

/* Fix earnings content positioning */
#earnings-content {
    background: transparent;
    width: 100%;
    box-sizing: border-box;
    display: block;
    margin: 0;
    padding: 0;
}

/* Enhanced Loading State - SINGLE DEFINITION */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: rgba(255, 255, 255, 0.9);
}

.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 1.5rem;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: #4ade80;
    animation-duration: 2s;
}

.spinner-ring:nth-child(2) {
    border-right-color: #22c55e;
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    border-bottom-color: rgba(74, 222, 128, 0.5);
    animation-duration: 1s;
}

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

.loading-text {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

/* Earnings Content Grid - SINGLE DEFINITION */
.earnings-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    max-width: 100%;
}

@media (min-width: 768px) {
    .earnings-content {
        display: grid;
        grid-template-columns: 3fr 1fr;
        grid-gap: 3rem;
        align-items: start;
    }
}

/* Main content takes proper space */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    min-width: 0;
    max-width: 100%;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 0;
    max-width: 100%;
}

/* Next Earnings Card */
.next-earnings-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 2rem;
}

.next-earnings-card h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
}

.earnings-date-section {
    margin-bottom: 1.5rem;
}

.earnings-date {
    font-size: 2rem;
    font-weight: 700;
    color: #4ade80;
    margin-bottom: 0.5rem;
}

.earnings-countdown {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

.earnings-time {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.earnings-estimates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.estimate-item {
    text-align: left;
}

.estimate-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.estimate-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

/* Historical Earnings Table */
.historical-earnings {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    overflow-x: auto;
}

.historical-earnings h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
}

.earnings-table-container {
    overflow-x: auto;
}

.earnings-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.earnings-table th {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 0.75rem 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.earnings-table td {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    padding: 0.75rem 0.75rem 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.earnings-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Status Indicators */
.status-positive {
    color: #4ade80 !important;
}

.status-negative {
    color: #f87171 !important;
}

.status-neutral {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Related Links Sidebar */
.related-links {
    background: transparent;
    padding: 0;
}

.related-links h4 {
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.related-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-links li {
    margin-bottom: 0.5rem;
}

.related-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem 0;
    display: block;
    transition: color 0.2s ease;
}

.related-links a:hover {
    color: #4ade80;
}

/* Error State */
.error-container {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.error-message {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: white;
}

.error-details {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
}

.retry-button {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid #4ade80;
    color: #4ade80;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.retry-button:hover {
    background: rgba(74, 222, 128, 0.2);
}

/* No Data State */
.no-data-container {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.no-data-message {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: white;
}

.no-data-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.table-note {
    margin-top: 1rem;
    text-align: center;
}

.table-note p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .breadcrumb-container,
    .content-container,
    .search-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .search-section {
        padding: 0.5rem 0;
    }
    
    #header-search-placeholder {
        max-width: 100%;
    }
    
    .search-section .ticker-search-container {
        max-width: 100%;
    }
    
    .breadcrumb-link span {
        display: none;
    }
    
    .breadcrumb-icon {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .earnings-estimates {
        grid-template-columns: 1fr;
    }
    
    .earnings-table {
        font-size: 0.8rem;
        min-width: 500px;
    }
}

/* Ticker Search Component */
.ticker-search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin-bottom: 0;
}

.ticker-search-form {
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    width: 1.25rem;
    height: 1.25rem;
    color: rgba(255, 255, 255, 0.5);
    z-index: 2;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    outline: none;
    margin: 0;
}

.search-input:focus {
    border-color: #4ade80;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.clear-button {
    position: absolute;
    right: 0.75rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.clear-button:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
}

.clear-button svg {
    width: 1rem;
    height: 1rem;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #111111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    margin-top: 0.25rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.suggestion-item {
    width: 100%;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    color: white;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(74, 222, 128, 0.1);
}

.suggestion-item.current {
    background: rgba(74, 222, 128, 0.15);
    border-left: 3px solid #4ade80;
}

.suggestion-item.loading {
    justify-content: flex-start;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    cursor: default;
}

.suggestion-item.no-results {
    color: rgba(255, 255, 255, 0.6);
    cursor: default;
    font-style: italic;
}

.ticker-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.ticker-symbol {
    font-weight: 700;
    font-size: 0.875rem;
    color: #4ade80;
    font-family: 'SF Mono', Monaco, monospace;
}

.ticker-name {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.2;
}

.current-badge {
    font-size: 0.75rem;
    color: #4ade80;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    background: rgba(74, 222, 128, 0.1);
    border-radius: 0.25rem;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.loading-spinner-small {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top: 2px solid #4ade80;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsive adjustments for ticker search */
@media (max-width: 768px) {
    .ticker-search-container {
        max-width: 100%;
        margin-bottom: 0;
    }
    
    .search-input {
        font-size: 0.8rem;
        padding: 0.75rem 1rem 0.75rem 2.75rem;
    }
    
    .search-icon {
        left: 0.875rem;
        width: 1rem;
        height: 1rem;
    }
}

@media (min-width: 1024px) {
    .main-content {
        max-width: none;
    }
    
    .sidebar-content {
        max-width: none;
    }
}