/**
 * Company Lookup API Frontend Styles
 */


/* ================================
   Company Search Form Styles
   ================================ */

.company-lookup-search-wrapper {
    max-width: 800px;
    margin: 40px auto;
}

.autoComplete_wrapper{
    display: block;
}

.company-lookup-search-form {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

#company-search-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fff;
    color: #1f2937;
}

#company-search-input::placeholder {
    color: #9ca3af;
    opacity: 1;
}

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

/* Override any autoComplete.js default colors */
.autoComplete_wrapper > input {
    color: #1f2937 !important;
}

.autoComplete_wrapper > input::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

.autoComplete_wrapper > input:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba( 102, 126, 234, 0.1 ) !important;
}

/* Fix text selection color */
#company-search-input::selection,
.autoComplete_wrapper > input::selection {
    background-color: #667eea !important;
    color: #fff !important;
}

#company-search-input::-moz-selection,
.autoComplete_wrapper > input::-moz-selection {
    background-color: #667eea !important;
    color: #fff !important;
}

.company-search-button {
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient( 135deg, #667eea 0%, #764ba2 100% );
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.company-search-button:hover {
    transform: translateY( -2px );
    box-shadow: 0 8px 20px rgba( 102, 126, 234, 0.3 );
}

.company-search-button:active {
    transform: translateY( 0 );
}

/* AutoComplete.js Custom Styles */
#autoComplete_list_1 {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.1 );
    margin-top: 8px;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

#autoComplete_list_1 li {
    padding: 0;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.2s ease;
}

#autoComplete_list_1 li:last-child {
    border-bottom: none;
}

#autoComplete_list_1 li:hover,
#autoComplete_list_1 li[aria-selected="true"] {
    background: #f9fafb;
}

.company-result-item {
    padding: 15px 20px;
}

.company-result-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.company-result-info {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 6px;
}

.company-result-info .company-number {
    background: #f3f4f6;
    color: #4b5563;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.company-result-info .company-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.company-result-info .status-active {
    background: #d1fae5;
    color: #065f46;
}

.company-result-info .status-dissolved,
.company-result-info .status-liquidation {
    background: #fee2e2;
    color: #991b1b;
}

.company-result-address {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 6px;
}

.no_result {
    padding: 20px;
    text-align: center;
    color: #6b7280;
}

.no_result span {
    font-size: 1rem;
}

/* Results counter */
.results_count {
    padding: 12px 20px;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    color: #4b5563;
    font-weight: 600;
    font-size: 0.9rem;
}

.results_count span {
    display: block;
}

/* Search Results Section */
.company-search-results {
    margin-top: 30px;
}

/* Responsive Search Form */
@media ( max-width: 640px ) {
    .company-lookup-search-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .company-search-button {
        width: 100%;
    }
    
    .company-result-title {
        font-size: 1rem;
    }
    
    .company-result-item {
        padding: 12px 15px;
    }
}


/* ================================
   Company Single Page Styles
   ================================ */
.company-lookup-wrapper {
    background: #f5f7fa;
    min-height: 100vh;
    padding: 40px 0px;
    margin: 0 auto;
}

.company-lookup-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Company Header */
.company-header {
    background: linear-gradient( 135deg, #667eea 0%, #764ba2 100% );
    color: #fff;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba( 0, 0, 0, 0.1 );
    position: relative;
}

.company-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    line-height: 1.2;
    color: #fff;
    padding-right: 140px;
}

.company-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    font-size: 1rem;
}

.company-number {
    background: rgba( 255, 255, 255, 0.2 );
    padding: 8px 16px;
    border-radius: 6px;
    backdrop-filter: blur( 10px );
}

.company-status {
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.company-status-active {
    background: #10b981;
    color: #fff;
}

.company-status-dissolved,
.company-status-liquidation {
    background: #ef4444;
    color: #fff;
}

.company-status-unknown {
    background: #6b7280;
    color: #fff;
}

/* Info Grid */
.company-info-grid {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax( 350px, 1fr ) );
    gap: 25px;
    margin-bottom: 30px;
}

/* Info Cards */
.company-info-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba( 0, 0, 0, 0.07 );
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.company-info-card:hover {
    transform: translateY( -5px );
    box-shadow: 0 12px 24px rgba( 0, 0, 0, 0.12 );
}

.card-title {
    background: linear-gradient( 135deg, #667eea 0%, #764ba2 100% );
    color: #fff;
    padding: 20px;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-icon {
    font-size: 1.5rem;
}

.card-content {
    padding: 25px;
}

/* Info Rows */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
    gap: 15px;
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-row:first-child {
    padding-top: 0;
}

.info-label {
    font-weight: 600;
    color: #4b5563;
    flex-shrink: 0;
}

.info-value {
    text-align: right;
    color: #1f2937;
    word-break: break-word;
}

.info-value.overdue {
    color: #ef4444;
    font-weight: 600;
}

/* Info Sections */
.info-section {
    margin-bottom: 20px;
}

.info-section:last-child {
    margin-bottom: 0;
}

.section-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

/* Address */
.company-address {
    font-style: normal;
    line-height: 1.8;
    color: #1f2937;
    font-size: 1rem;
}

/* Warning Notice */
.warning-notice {
    background: #fef3c7;
    color: #92400e;
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 15px;
    font-weight: 500;
    border-left: 4px solid #f59e0b;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* SIC Codes */
.sic-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sic-code-badge {
    background: linear-gradient( 135deg, #667eea 0%, #764ba2 100% );
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Previous Names */
.previous-name-item {
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid #667eea;
}

.previous-name-item:last-child {
    margin-bottom: 0;
}

.date-range {
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 5px;
    display: inline-block;
}

/* Status Grid */
.status-grid {
    display: grid;
    gap: 12px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
}

.status-ok {
    background: #d1fae5;
    color: #065f46;
}

.status-warning {
    background: #fee2e2;
    color: #991b1b;
}

.status-info {
    background: #dbeafe;
    color: #1e40af;
}

.status-icon {
    font-size: 1.3rem;
}

.status-text {
    font-size: 1rem;
}

/* Footer */
.company-footer {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba( 0, 0, 0, 0.07 );
    text-align: center;
}

.data-source-notice {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Responsive Design */
@media ( max-width: 768px ) {
    .company-lookup-wrapper {
        padding: 20px 15px;
    }

    .company-header {
        padding: 25px 20px;
    }

    .company-title {
        font-size: 1.8rem;
    }

    .company-info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .company-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .info-value {
        text-align: left;
    }

    .card-title {
        font-size: 1.1rem;
        padding: 15px;
    }

    .card-content {
        padding: 20px;
    }
}

@media ( max-width: 480px ) {
    .company-title {
        font-size: 1.5rem;
    }

    .company-header {
        padding: 20px 15px;
    }

    .card-content {
        padding: 15px;
    }
}

/* JavaScript Enhanced Styles */

/* Copy Tooltip */
.copy-tooltip {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX( -50% );
    background: rgba( 0, 0, 0, 0.8 );
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
}

.copy-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX( -50% );
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba( 0, 0, 0, 0.8 );
}

.company-number {
    position: relative;
    transition: background 0.3s ease;
}

/* Print Button */
.company-print-btn {
    position: absolute;
    top: 40px;
    right: 40px;
    background: rgba( 255, 255, 255, 0.25 );
    color: #fff;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur( 10px );
    box-shadow: 0 4px 12px rgba( 0, 0, 0, 0.1 );
}

.company-print-btn:hover {
    background: rgba( 255, 255, 255, 0.35 );
    transform: translateY( -2px );
    box-shadow: 0 6px 16px rgba( 0, 0, 0, 0.15 );
}

.company-print-btn:active {
    transform: translateY( 0 );
}

.company-print-btn svg {
    width: 20px;
    height: 20px;
}

@media ( max-width: 768px ) {
    .company-title {
        padding-right: 0;
        margin-bottom: 15px;
    }
    
    .company-print-btn {
        position: static;
        width: 100%;
        justify-content: center;
        margin-top: 20px;
    }
}

/* Expandable Content */
.previous-name-item.expandable {
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.previous-name-item.expandable[data-collapsed="false"] {
    max-height: none;
}

.expand-toggle {
    background: transparent;
    color: #667eea;
    border: none;
    padding: 5px 0;
    margin-top: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: underline;
}

.expand-toggle:hover {
    color: #764ba2;
}

/* Animation Classes */
.company-info-card {
    opacity: 0;
    transform: translateY( 20px );
}

.company-info-card.animated {
    animation: fadeInUp 0.5s ease forwards;
}

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

/* Loading Skeleton (optional) */
.loading-skeleton {
    position: relative;
    overflow: hidden;
}

.loading-skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient( 90deg, transparent, rgba( 255, 255, 255, 0.3 ), transparent );
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        transform: translateX( -100% );
    }
    100% {
        transform: translateX( 100% );
    }
} 