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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    line-height: 1.6;
}

.topbar {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

.topbar h1 {
    font-size: 1.75rem;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #94a3b8;
    font-size: 0.9rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
}

.card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.filter-section {
    background: #0f172a;
    border: 1px solid #334155;
}

.filter-form {
    width: 100%;
}

.filter-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-input {
    flex: 1;
    padding: 0.75rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.95rem;
}


.filter-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.lead-count {
    margin-bottom: 1rem;
    color: #94a3b8;
}

.lead-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.lead-row:hover {
    border-color: #475569;
    background: #1a2332;
}

.lead-info {
    flex: 1;
    display: flex;
    gap: 2rem;
}

.lead-main h3 {
    font-size: 1.25rem;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.lead-email {
    color: #3b82f6;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.lead-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.lead-details p {
    margin: 0;
}

.lead-details a {
    color: #60a5fa;
    text-decoration: none;
}

.lead-details a:hover {
    text-decoration: underline;
}

.lead-actions-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    min-width: 180px;
}

.lead-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.button-toggle {
    background: #334155;
    color: #e2e8f0;
    padding: 0.5rem 0.75rem;
    border: 1px solid #475569;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    min-width: auto;
    width: auto;
}

.button-toggle:hover {
    background: #475569;
    border-color: #64748b;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 0.9rem;
}

.button {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.button-primary {
    background: #3b82f6;
    color: white;
}

.button-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.button-secondary {
    background: #475569;
    color: #e2e8f0;
}

.button-secondary:hover {
    background: #64748b;
}

.button-danger {
    background: #dc2626;
    color: white;
}

.button-danger:hover {
    background: #b91c1c;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #334155;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: #f1f5f9;
}

.modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: #334155;
    color: #e2e8f0;
}

.modal-body {
    padding: 1.5rem;
}

.lead-preview {
    background: #0f172a;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.lead-preview p {
    margin: 0.5rem 0;
}

.lead-preview code {
    color: #3b82f6;
    font-family: 'Courier New', monospace;
}

.record-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #e2e8f0;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group small {
    color: #94a3b8;
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.form-actions .button {
    min-width: 120px;
}

hr {
    border: none;
    border-top: 1px solid #334155;
    margin: 1.5rem 0;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    padding: 1rem 1.5rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease;
    min-width: 300px;
    max-width: 400px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-danger {
    border-left: 4px solid #dc2626;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
}

/* Responsive */
@media (max-width: 768px) {
    .lead-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .lead-actions-wrapper {
        width: 100%;
        align-items: stretch;
    }
    
    .lead-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .lead-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .lead-details {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        flex-direction: column;
    }
}
