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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    min-height: 100vh;
}

/* Header */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.credits-display {
    padding: 8px 14px;
    background: linear-gradient(135deg, #440A86 0%, #6B21A8 100%);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.credits-display.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.credits-display.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.header-logo {
    width: 50px;
    height: auto;
    border-radius: 8px;
}

.app-title {
    font-size: 24px;
    font-weight: 600;
    color: #440A86;
    margin: 0;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fee2e2;
}

.logout-btn svg {
    flex-shrink: 0;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
}

.tab:hover {
    color: #440A86;
}

.tab.active {
    color: #440A86;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #440A86, #6B21A8);
    border-radius: 2px 2px 0 0;
}

/* Tab Content */
.tab-content {
    display: none;
}

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

/* Section Title */
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #440A86;
    margin-bottom: 24px;
}

/* Search Form */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.input-group {
    flex: 1;
    min-width: 200px;
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group:focus-within {
    border-color: #440A86;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.input-group.full-width {
    flex: 1 1 100%;
}

.input-icon {
    padding: 12px 0 12px 16px;
    color: #9ca3af;
    display: flex;
    align-items: center;
}

.input-group input,
.input-group select {
    flex: 1;
    padding: 14px 16px 14px 12px;
    border: none;
    background: transparent;
    font-size: 16px;
    color: #333;
    outline: none;
}

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

.input-group select {
    cursor: pointer;
    appearance: none;
    padding-right: 40px;
}

.select-group::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #9ca3af;
    pointer-events: none;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.btn-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #440A86 0%, #6B21A8 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

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

.btn-search:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Results Section */
.results-section {
    margin-top: 32px;
    padding: 24px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.results-section.hidden {
    display: none;
}

.results-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
}

#results-content {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
}

/* Result Card */
.result-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    background: #fff;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.result-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #440A86 0%, #6B21A8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
}

.result-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.result-name {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.result-title {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.result-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
}

.result-item-icon {
    color: #440A86;
    flex-shrink: 0;
    margin-top: 2px;
}

.result-item-content {
    flex: 1;
}

.result-item-label {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-item-value {
    font-size: 14px;
    color: #374151;
    word-break: break-word;
}

.result-item-value a {
    color: #440A86;
    text-decoration: none;
}

.result-item-value a:hover {
    text-decoration: underline;
}

/* Copy button */
.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: #440A86;
    border-color: #440A86;
    color: #fff;
}

.copy-btn:hover svg {
    stroke: #fff;
}

.copy-btn:active {
    transform: scale(0.95);
}

/* Phones Section */
.phones-section {
    grid-column: 1 / -1;
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.phones-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.phones-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.phones-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 15px;
}

.phones-title svg {
    color: #440A86;
}

.copy-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: #440A86;
    border: 1px solid #440A86;
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-all-btn:hover {
    background: #350768;
    border-color: #350768;
}

.copy-all-btn:active {
    transform: scale(0.98);
}

.copy-all-btn svg {
    stroke: #fff;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.filter-checkbox:hover {
    border-color: #440A86;
    color: #440A86;
}

.filter-checkbox input {
    accent-color: #440A86;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.phones-list {
    display: grid;
    gap: 8px;
}

.phone-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.phone-card:hover {
    border-color: #440A86;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.1);
}

.phone-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.phone-type {
    font-size: 18px;
    flex-shrink: 0;
}

.phone-number {
    font-weight: 600;
    font-size: 15px;
    color: #1f2937;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    white-space: nowrap;
}

.phone-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.phone-badge.whatsapp {
    background: #dcfce7;
    color: #166534;
}

.phone-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #9ca3af;
    padding-left: 32px;
}

.phone-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Social Section */
.social-section {
    grid-column: 1 / -1;
    background: #f0f9ff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.social-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.social-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 15px;
}

.social-title svg {
    color: #0ea5e9;
}

.social-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.social-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 16px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-card:hover {
    border-color: #0ea5e9;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15);
    transform: translateY(-1px);
}

.social-icon {
    font-size: 24px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 8px;
}

.social-card.social-linkedin .social-icon {
    background: #e0f2fe;
}

.social-card.social-twitter .social-icon {
    background: #f1f5f9;
}

.social-card.social-facebook .social-icon {
    background: #dbeafe;
}

.social-card.social-instagram .social-icon {
    background: #fce7f3;
}

.social-card.social-github .social-icon {
    background: #f3f4f6;
}

.social-info {
    flex: 1;
    min-width: 0;
}

.social-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

.social-url {
    display: block;
    font-size: 12px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.social-arrow {
    color: #9ca3af;
    flex-shrink: 0;
}

.social-card:hover .social-arrow {
    color: #0ea5e9;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px;
    color: #6b7280;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #440A86;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error Message */
.error-message {
    margin-top: 24px;
    padding: 16px 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #dc2626;
    font-size: 14px;
}

.error-message.hidden {
    display: none;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Raw JSON Toggle */
.json-toggle {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.json-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.json-toggle-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.json-content {
    margin-top: 12px;
    padding: 16px;
    background: #1f2937;
    border-radius: 8px;
    overflow-x: auto;
    display: none;
}

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

.json-content pre {
    color: #a5f3fc;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .header-bar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .header-left {
        justify-content: center;
    }

    .header-logo {
        width: 40px;
    }

    .app-title {
        font-size: 18px;
    }

    .logout-btn {
        justify-content: center;
    }

    .tabs {
        flex-wrap: wrap;
        gap: 4px;
    }

    .tab {
        font-size: 12px;
        padding: 8px 12px;
        flex: 1;
        text-align: center;
        min-width: auto;
    }

    .section-title {
        font-size: 16px;
        margin-bottom: 16px;
    }

    .form-row {
        flex-direction: column;
    }

    .input-group {
        min-width: 100%;
    }

    .form-actions {
        justify-content: stretch;
    }

    .btn-search {
        width: 100%;
        justify-content: center;
    }

    /* Results responsive */
    .result-card {
        padding: 16px;
    }

    .phones-container {
        gap: 8px;
    }

    .phone-card {
        padding: 10px 12px;
        font-size: 13px;
    }

    .social-profiles {
        gap: 8px;
    }

    .social-link {
        padding: 8px 12px;
        font-size: 12px;
    }

    .filter-container {
        flex-wrap: wrap;
        gap: 8px;
    }

    .copy-all-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    .header-logo {
        width: 35px;
    }

    .app-title {
        font-size: 16px;
    }

    .tab {
        font-size: 11px;
        padding: 6px 8px;
    }

    .input-group input,
    .input-group select {
        padding: 12px 12px 12px 8px;
        font-size: 14px;
    }

    .input-icon {
        padding: 10px 0 10px 12px;
    }

    .input-icon svg {
        width: 16px;
        height: 16px;
    }

    /* Phone cards mobile */
    .phone-card {
        padding: 10px;
    }

    .phone-main {
        gap: 8px;
    }

    .phone-type {
        font-size: 16px;
    }

    .phone-number {
        font-size: 14px;
    }

    .phone-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .phone-meta {
        padding-left: 0;
        flex-wrap: wrap;
        gap: 8px;
    }

    .copy-btn {
        padding: 6px;
    }

    .filter-checkbox span {
        font-size: 13px;
    }
}
}
