/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto; /* Controlled by JS for smooth scrolling */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f3f4f6;
    color: #1f2937;
    line-height: 1.6;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1DAE97 0%, #158f7d 100%);
    color: white;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-nav {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    opacity: 0.9;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #00c9a7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Main Container */
.main-container {
    display: flex;
    min-height: calc(100vh - 90px);
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: white;
    border-right: 1px solid #e5e7eb;
    padding: 1.5rem 0;
}

.sidebar-section {
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.sidebar-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: #374151;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.sidebar-menu a svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.sidebar-menu a:hover {
    background-color: #f3f4f6;
    color: #1DAE97;
}

/* Content Area */
.content {
    flex: 1;
    padding: 2rem;
}

#view-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    min-height: 600px;
}

/* View Header */
.view-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.view-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.view-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.card-icon {
    font-size: 2rem;
    opacity: 0.3;
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon svg {
    width: 48px;
    height: 48px;
}

.card.card-blue {
    background: linear-gradient(135deg, #1DAE97 0%, #158f7d 100%);
}

.card.card-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

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

.card.card-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.card-title {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-change {
    font-size: 0.875rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-change svg {
    width: 14px;
    height: 14px;
}

/* Chart Containers */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-box {
    background-color: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #374151;
}

.chart {
    height: 200px;
    background: linear-gradient(to top, #d1fae5 0%, #fff 100%);
    border-radius: 4px;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    gap: 0.5rem;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(to top, #1DAE97, #5dd4bf);
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
    position: relative;
}

.chart-bar:hover {
    opacity: 0.8;
}

/* Data Table */
.table-container {
    overflow-x: auto;
    margin-top: 1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    background-color: #f9fafb;
}

.data-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.data-table td svg {
    width: 14px;
    height: 14px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
    opacity: 0.6;
}

.data-table tbody tr {
    transition: background-color 0.2s;
    cursor: pointer;
}

.data-table tbody tr:hover {
    background-color: #f9fafb;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-new {
    background-color: #d1fae5;
    color: #047857;
}

.badge-qualified {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-proposal {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-negotiation {
    background-color: #fce7f3;
    color: #9f1239;
}

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

.badge-active {
    background-color: #d1fae5;
    color: #065f46;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

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

.form-group-full {
    grid-column: 1 / -1;
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 0.875rem;
}

.form-input,
.form-select,
.form-textarea {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #1DAE97;
    box-shadow: 0 0 0 3px rgba(29, 174, 151, 0.1);
}

.form-input.filling,
.form-select.filling,
.form-textarea.filling {
    border-color: #1DAE97;
    box-shadow: 0 0 0 3px rgba(29, 174, 151, 0.2);
    background-color: #f0fdfa;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.01); }
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.button-primary {
    background-color: #1DAE97;
    color: white;
}

.button-primary:hover {
    background-color: #158f7d;
}

.button-secondary {
    background-color: #e5e7eb;
    color: #374151;
}

.button-secondary:hover {
    background-color: #d1d5db;
}

/* Loading Spinner */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #6b7280;
}

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

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

/* Status Bar */
.status-bar {
    background-color: #1f2937;
    color: #9ca3af;
    padding: 0.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    font-size: 0.75rem;
    height: 30px;
}

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

.status-active {
    color: #10b981;
    font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Detail View */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.detail-info {
    flex: 1;
}

.detail-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.detail-meta {
    color: #6b7280;
    font-size: 0.875rem;
}

.detail-sections {
    display: grid;
    gap: 2rem;
}

.detail-section {
    background-color: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title svg {
    width: 18px;
    height: 18px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 0.875rem;
    color: #111827;
    font-weight: 500;
}

/* Activity Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e5e7eb;
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #1DAE97;
    border: 2px solid white;
}

.timeline-date {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.timeline-date svg {
    width: 12px;
    height: 12px;
}

.timeline-content {
    font-size: 0.875rem;
    color: #374151;
}
