/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo h2 {
    font-weight: 600;
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.role-selector select {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
}

.role-selector select option {
    background: #333;
    color: white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.user-profile i {
    font-size: 1.5rem;
}

/* Main Container */
.main-container {
    display: flex;
    margin-top: 80px;
    min-height: calc(100vh - 80px);
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    padding: 2rem 0;
    position: fixed;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #f8f9fa;
    border-left-color: #667eea;
}

.nav-item.active {
    background: #e3f2fd;
    border-left-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

.nav-item i {
    font-size: 1.2rem;
    width: 20px;
}

/* Content Area */
.content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
    background: #f5f7fa;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.section-header h2 {
    color: #333;
    font-size: 2rem;
    font-weight: 600;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
}

/* Button Styles */
.btn-primary, .btn-secondary, .btn-success, .btn-call, .btn-whatsapp, .btn-search {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #25d366;
    color: white;
}

.btn-call {
    background: #007bff;
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
}

.btn-call:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.btn-whatsapp {
    background: #25d366;
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
    transition: all 0.3s ease;
}

.btn-whatsapp:hover {
    background: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.btn-search {
    background: #667eea;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0 25px 25px 0;
}

.btn-primary:hover, .btn-secondary:hover, .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
}

.metric-card.urgent {
    border-left: 5px solid #dc3545;
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.metric-card.urgent .metric-icon {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.metric-info h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    display: block;
}

.metric-info p {
    font-size: 0.8rem;
    color: #888;
}

/* Priority Section */
.priority-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.priority-section h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.3rem;
}

.action-cards {
    display: grid;
    gap: 1rem;
}

.action-card {
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 5px solid #28a745;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.action-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.action-card.high-priority {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #fff5f5 0%, #f8f9fa 100%);
}

.action-card.medium-priority {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #fffbf0 0%, #f8f9fa 100%);
}

.action-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.action-header .action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.priority-badge {
    background: #dc3545;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.action-card.medium-priority .priority-badge {
    background: #ffc107;
    color: #333;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-card h4 {
    color: #333;
    margin-bottom: 0.5rem;
}

.action-card p {
    color: #666;
    margin-bottom: 0.5rem;
}

.action-card small {
    color: #888;
    font-size: 0.85rem;
}

/* Search Bar */
.search-bar {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-bar input {
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    flex: 1;
    outline: none;
}

/* Supplier Grid */
.supplier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.supplier-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.supplier-card:hover {
    transform: translateY(-5px);
}

.supplier-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.supplier-info h3 {
    margin-bottom: 0.5rem;
}

.status-badge {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.hot-seller {
    background: #dc3545;
}

.contact-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.supplier-details {
    padding: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.label {
    font-weight: 600;
    color: #666;
}

.value {
    color: #333;
}

.supplier-actions {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    display: flex;
    gap: 1rem;
}

/* Floating Action Button */
.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.fab:hover {
    transform: scale(1.1) rotate(45deg);
}

.fab-options {
    position: absolute;
    bottom: 80px;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 1rem;
}

.fab-options.active {
    display: flex;
}

.fab-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    color: #333;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.fab-option:hover {
    transform: translateX(-5px);
    background: #667eea;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar .nav-item span {
        display: none;
    }
    
    .content {
        margin-left: 60px;
        padding: 1rem;
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .supplier-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .quick-actions {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .fab-container {
        bottom: 1rem;
        right: 1rem;
    }
    
    .fab {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .fab-option {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Call Interface Modal */
.call-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-in;
}

.call-interface {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    width: 350px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.call-header h3 {
    color: #333;
    font-size: 1.2rem;
}

.close-call {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-call:hover {
    background: #f0f0f0;
}

.call-status {
    margin-bottom: 2rem;
}

.call-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.call-duration {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.call-state {
    color: #666;
    font-size: 1rem;
}

.call-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.call-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mute-btn {
    background: #6c757d;
}

.hold-btn {
    background: #ffc107;
}

.end-btn {
    background: #dc3545;
}

.call-btn:hover {
    transform: scale(1.1);
}

.call-btn:active {
    transform: scale(0.95);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Status Indicators */
.status-online {
    color: #28a745;
}

.status-offline {
    color: #dc3545;
}

.status-busy {
    color: #ffc107;
}

/* Buyer Styles */
.buyer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.buyer-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.buyer-card:hover {
    transform: translateY(-5px);
}

.buyer-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.buyer-badges {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.plan-badge {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.plan-badge.platinum {
    background: #e5e5e5;
    color: #333;
}

.credit-approved {
    color: #28a745;
    font-weight: 600;
}

/* Offers Table */
.offers-table {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden;
}

.offers-table table {
    width: 100%;
    border-collapse: collapse;
}

.offers-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e9ecef;
}

.offers-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.offers-table tr:hover {
    background: #f8f9fa;
}

.grade-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.rate {
    font-weight: 600;
    color: #28a745;
    font-size: 1.1rem;
}

.supplier-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.supplier-actions {
    display: flex;
    gap: 0.25rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.offer-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.offer-filters select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 25px;
    background: white;
    font-size: 0.9rem;
}

/* IRM Styles */
.irm-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-btn:hover {
    color: #667eea;
}

.irm-content {
    display: grid;
    gap: 1.5rem;
}

.irm-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden;
}

.irm-header {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.irm-info h4 {
    margin-bottom: 0.5rem;
}

.status-badge.active {
    background: rgba(255,255,255,0.2);
}

.irm-details {
    padding: 1.5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item .label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 600;
}

.detail-item .value {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

.irm-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    display: flex;
    gap: 1rem;
}

/* Call Interface Styles */
.call-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    color: #666;
    font-size: 0.9rem;
}

.call-interface-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.dialer-section, .call-history-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.dialer-section h3, .call-history-section h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.dialer-keypad {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.dialer-keypad input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
}

.recent-contacts h4 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1rem;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: #e9ecef;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contact-name {
    font-weight: 600;
    color: #333;
}

.contact-company {
    font-size: 0.9rem;
    color: #666;
}

.contact-number {
    font-size: 0.8rem;
    color: #888;
}

.contact-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.call-history-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.call-history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.call-history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.call-history-item:hover {
    background: #e9ecef;
}

.call-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.call-icon.incoming {
    background: #28a745;
}

.call-icon.outgoing {
    background: #007bff;
}

.call-icon.missed {
    background: #dc3545;
}

.call-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.caller-name {
    font-weight: 600;
    color: #333;
}

.caller-number {
    font-size: 0.9rem;
    color: #666;
}

.call-time {
    font-size: 0.8rem;
    color: #888;
}

.call-actions {
    display: flex;
    gap: 0.5rem;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}
