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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Login Screen Styles */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f5f5f5;
    padding: 20px;
    position: relative;
}

.login-masthead {
    margin-bottom: 30px;
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.masthead-image {
    width: 100%;
    max-height: 120px;
    height: auto;
    object-fit: contain;
    display: block;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .masthead-image {
        max-width: 100%;
        max-height: 100px;
    }
    
    .login-masthead {
        margin-bottom: 20px;
    }
}

.login-footer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
}

@media (max-height: 700px), (max-width: 768px) {
    .login-container {
        justify-content: flex-start;
        padding-top: 10px;
        padding-bottom: 60px; /* Space for footer */
    }
    
    .login-form {
        padding: 30px;
        margin-bottom: 20px;
    }
    
    .login-form h1 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    
    .login-form p {
        margin-bottom: 20px;
        font-size: 14px;
    }
    
    .login-footer {
        position: fixed;
        bottom: 10px;
        font-size: 12px;
    }
}

.login-form {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-form h1 {
    margin-bottom: 10px;
    color: #333;
    font-size: 2rem;
}

.login-form p {
    margin-bottom: 30px;
    color: #666;
    line-height: 1.5;
}

.login-form input[type="password"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 20px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.login-form input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Make header relative for logout button positioning */
header {
    position: relative;
    padding-right: 120px; /* Add space for logout button */
}

@media (max-width: 768px) {
    header {
        padding-right: 100px; /* Less padding on mobile */
    }
    
    .logout-btn {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

header {
    text-align: center;
    margin-bottom: 25px;
}

header h1 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 2.2rem;
}

header p {
    color: #7f8c8d;
    font-size: 1rem;
    margin-bottom: 0;
}

.upload-section {
    margin-bottom: 25px;
}

.upload-area {
    border: 3px dashed #bdc3c7;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.upload-area.dragover {
    border-color: #3498db;
    background-color: #e3f2fd;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: #7f8c8d;
}

.upload-content h3 {
    color: #2c3e50;
    font-size: 1.3rem;
}

.ai-note {
    color: #3498db;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 5px;
}

.privacy-disclaimer {
    color: #c0392b !important;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 8px;
}

.loading {
    text-align: center;
    padding: 40px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #3498db;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.results-section {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.results-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.6rem;
}

.results-header {
    margin-bottom: 12px;
}

.results-header h2 {
    color: #2c3e50;
    font-size: 1.6rem;
    margin: 0 0 3px 0;
}

.contact-count {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.results-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.action-buttons {
    margin: 12px 0;
    text-align: center;
}

.btn-try-again {
    width: 100%;
    max-width: 300px;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    transition: background-color 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #3498db;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(26px);
}

.toggle-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 500;
}

.contact-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: all 0.3s ease;
    margin-bottom: 2px;
}

.input-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.contact-field.empty {
    display: none;
}

.contact-field.empty.show-empty {
    display: flex;
    opacity: 0.6;
}

.contact-field.empty.show-empty input {
    border-style: dashed;
    background-color: #f8f9fa;
}

.contact-count {
    color: #7f8c8d;
    font-size: 1rem;
    margin: 0;
    font-weight: 500;
}

.btn-outline {
    background-color: transparent;
    color: #7f8c8d;
    border: 2px solid #bdc3c7;
}

.btn-outline:hover {
    background-color: #ecf0f1;
    border-color: #95a5a6;
    color: #2c3e50;
}

.action-buttons {
    margin: 20px 0;
    text-align: center;
}

.btn-try-again {
    width: 100%;
    max-width: 300px;
}

.contacts-container {
    display: grid;
    gap: 15px;
    margin-bottom: 15px;
}

.contact-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    transition: all 0.3s ease;
    position: relative;
}

.contact-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

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

.contact-card h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    flex: 1;
}

.btn-reset {
    background-color: #ecf0f1;
    color: #7f8c8d;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background-color: #d5dbdb;
    color: #2c3e50;
    border-color: #95a5a6;
}

.contact-card h3::before {
    content: "👤";
    font-size: 1rem;
}

.contact-info {
    display: grid;
    gap: 8px;
}

.contact-field {
    display: flex;
    align-items: center;
    gap: 15px;
}

.contact-field label {
    font-weight: 600;
    color: #555;
    min-width: 80px;
    font-size: 0.95rem;
}

.contact-field input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: white;
}

.contact-field input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background-color: #f8f9fa;
}

.contact-field input:not(:placeholder-shown) {
    border-color: #27ae60;
}

.contact-field input.modified {
    border-color: #f39c12;
    background-color: #fef9e7;
}

.contact-field input.modified:focus {
    border-color: #e67e22;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

.contact-field input.invalid {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

.contact-field input.invalid:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.field-status {
    font-size: 0.8rem;
    margin-top: 4px;
    min-height: 16px;
}

.field-status.modified {
    color: #f39c12;
}

.field-status.invalid {
    color: #e74c3c;
}

.field-status.valid {
    color: #27ae60;
}

/* Add icons to labels */
.contact-field label[for*="name"]::before { content: "👤 "; }
.contact-field label[for*="email"]::before { content: "📧 "; }
.contact-field label[for*="phone"]::before { content: "📞 "; }
.contact-field label[for*="company"]::before { content: "🏢 "; }
.contact-field label[for*="title"]::before { content: "💼 "; }
.contact-field label[for*="website"]::before { content: "🌐 "; }
.contact-field label[for*="address"]::before { content: "📍 "; }

.download-section {
    border-top: 1px solid #e0e0e0;
    padding-top: 30px;
}

.download-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.download-dropdown-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.format-select {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    background-color: white;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.format-select:hover {
    border-color: #3498db;
}

.format-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.download-action {
    padding: 12px 24px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.download-action:hover {
    background: #229954;
}

.download-action:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.download-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.instruction-banner {
    background: linear-gradient(135deg, #e8f4fd 0%, #d6eaff 100%);
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 12px;
}

.instruction-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.instruction-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.instruction-text {
    color: #2c3e50;
    font-size: 0.85rem;
    line-height: 1.2;
}

.download-section h3 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.download-description {
    color: #7f8c8d;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.download-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 150px;
    text-align: center;
}

.btn small {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.8;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
    transform: translateY(-2px);
}

.error-message {
    background-color: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: center;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        margin-bottom: 20px;
    }
    
    header h1 {
        font-size: 1.7rem;
        margin-bottom: 3px;
    }
    
    header p {
        font-size: 0.95rem;
        margin-bottom: 0;
    }
    
    .upload-section {
        margin-bottom: 20px;
    }
    
    .upload-area {
        padding: 30px 12px;
    }
    
    .privacy-disclaimer {
        font-size: 0.8rem;
    }
    
    .results-section {
        padding: 12px;
    }
    
    .results-header {
        margin-bottom: 10px;
    }
    
    .results-header h2 {
        font-size: 1.3rem;
        margin-bottom: 2px;
    }
    
    .contact-count {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .instruction-banner {
        padding: 6px;
        margin-bottom: 10px;
    }
    
    .instruction-text {
        font-size: 0.75rem;
    }
    
    .contacts-container {
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .contact-card {
        padding: 10px;
    }
    
    .contact-header {
        margin-bottom: 8px;
    }
    
    .contact-card h3 {
        font-size: 0.95rem;
    }
    
    .btn-reset {
        padding: 2px 5px;
        font-size: 0.6rem;
    }
    
    .contact-info {
        gap: 5px;
    }
    
    .contact-field {
        flex-direction: column;
        align-items: stretch;
        gap: 3px;
        margin-bottom: 0px;
    }
    
    .contact-field label {
        min-width: auto;
        font-size: 0.75rem;
        margin-top: 0;
    }
    
    .contact-field input {
        padding: 5px 7px;
        font-size: 11px;
    }
    
    .field-status {
        font-size: 0.6rem;
        margin-top: 1px;
        min-height: 9px;
    }
    
    .toggle-label {
        font-size: 0.75rem;
    }
    
    .action-buttons {
        margin: 10px 0;
    }
    
    .download-section {
        margin-top: 10px;
    }
    
    .download-section h3 {
        font-size: 1rem;
        margin-bottom: 3px;
    }
    
    .download-description {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }
    
    .download-dropdown-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .format-select {
        width: 100%;
        padding: 10px 12px;
        padding-right: 35px;
        font-size: 14px;
        background-size: 14px;
        background-position: right 10px center;
    }
    
    .download-action {
        width: 100%;
        padding: 10px 16px;
        font-size: 14px;
    }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 15px 20px;
    font-size: 0.8rem;
    margin-top: auto;
}

.footer p {
    margin: 0;
}

.footer a {
    color: #3498db;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}
.upload-content p {
    color: #7f8c8d;
    font-size: 0.9rem;
}
/* Textarea styles for multiple values */
.contact-field textarea {
    flex: 1;
    padding: 6px 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    transition: all 0.3s ease;
    background-color: white;
    font-family: inherit;
    resize: vertical;
    min-height: 40px;
}

.contact-field textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background-color: #f8f9fa;
}

.contact-field textarea:not(:placeholder-shown) {
    border-color: #27ae60;
}

.contact-field textarea.modified {
    border-color: #f39c12;
    background-color: #fef9e7;
}

.contact-field textarea.modified:focus {
    border-color: #e67e22;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

.contact-field textarea.invalid {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

.contact-field textarea.invalid:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}


/* Image Tips Styles */
.image-tips {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    text-align: left;
}

.tips-header {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.tips-list {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: #555;
}

.tips-list li {
    margin-bottom: 4px;
    line-height: 1.4;
}

.tips-list li:last-child {
    margin-bottom: 0;
}

.privacy-disclaimer {
    margin: 10px 0 5px 0;
}

.ai-note {
    margin: 5px 0;
}
