:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border-color: rgba(255, 255, 255, 0.1);
    
    /* Status Colors */
    --status-pending: #94a3b8;
    --status-interested: #10b981;
    --status-followup: #f59e0b;
    --status-not-interested: #ef4444;
    --status-not-connected: #f97316;
    --status-converted: #8b5cf6;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    background-image: radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.15), transparent 25%);
    background-attachment: fixed;
}

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

header {
    margin-bottom: 2rem;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #60a5fa, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

.nav-btn {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.nav-btn:hover {
    background: rgba(59, 130, 246, 0.2);
}

.search-container {
    position: relative;
    max-width: 400px;
    flex-grow: 1;
}

.search-container i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-container input {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(12px);
}

.search-container input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.top-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-container select {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(12px);
    cursor: pointer;
}

.filter-container select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.upload-container form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

input[type="file"] {
    display: none;
}

.custom-file-upload {
    cursor: pointer;
    color: var(--accent);
    font-weight: 500;
    transition: color 0.2s ease;
}

.custom-file-upload:hover {
    color: var(--accent-hover);
}

.file-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: background 0.2s ease;
}

.upload-btn:hover {
    background: var(--accent-hover);
}

.flash-messages {
    margin-bottom: 1.5rem;
}

.flash {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flash-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.flash-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.table-container {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    background: rgba(15, 23, 42, 0.4);
}

.lead-row {
    transition: background-color 0.2s ease;
}

.lead-row:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.details-cell strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.details-cell .category {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border-radius: 999px;
    margin-bottom: 0.25rem;
}

.details-cell .location {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.contact-cell .phone, .contact-cell .website {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: #e2e8f0;
}

.contact-cell a {
    color: #60a5fa;
    text-decoration: none;
}
.contact-cell a:hover {
    text-decoration: underline;
}

/* Form Elements */
select.status-select, input.alt-phone-input, textarea.remarks-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    outline: none;
}

select.status-select:focus, input.alt-phone-input:focus, textarea.remarks-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

textarea.remarks-input {
    resize: vertical;
    min-height: 42px;
}

/* Status Specific Styles */
.status-select {
    cursor: pointer;
    font-weight: 500;
}

.status-pending .status-select { border-left: 4px solid var(--status-pending); }
.status-interested .status-select { border-left: 4px solid var(--status-interested); }
.status-need-to-follow-up .status-select { border-left: 4px solid var(--status-followup); }
.status-not-interested .status-select {
    color: var(--status-not-interested);
    border-color: rgba(239, 68, 68, 0.3);
}

.status-not-connected .status-select {
    color: var(--status-not-connected);
    border-color: rgba(249, 115, 22, 0.3);
}


.status-lead-converted td {
    background-color: rgba(139, 92, 246, 0.05);
}
.status-lead-converted .status-select {
    color: var(--status-converted);
    border-color: rgba(139, 92, 246, 0.3);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    font-weight: 500;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    
    table, thead, tbody, th, td, tr {
        display: block;
    }
    
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr {
        margin-bottom: 1.5rem;
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 1rem;
    }
    
    td {
        border: none;
        padding: 0.5rem 0;
        position: relative;
    }
    
    td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: var(--text-secondary);
        margin-bottom: 0.25rem;
        font-weight: 600;
    }
    
    .status-cell, .input-cell {
        margin-top: 0.5rem;
    }
}

.phone-link {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
}

.phone-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.phone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}
