:root {
    --primary: #0284c7;
    --primary-light: #0ea5e9;
    --primary-dark: #0369a1;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-700: #334155;
    --success: #059669;
    --error: #dc2626;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-700);
    line-height: 1.5;
    min-height: 100vh;
}

/* Header */
.header {
    background: white;
    padding: 0.75rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.5rem;
}

.logo svg {
    width: 2rem;
    height: 2rem;
}

/* Navigation */
.side-nav {
    position: fixed;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: white;
    padding: 0.75rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.nav-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    color: var(--gray-700);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--gray-50);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
}

/* Main Container */
.main-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Upload Card */
.upload-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    overflow: hidden;
}

.card-header {
    background: var(--primary);
    padding: 1.5rem;
    color: white;
}

.card-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.card-body {
    padding: 2rem;
}

/* Form Sections */
.form-section {
    background: var(--gray-50);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.form-section-title {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

input[type="text"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 1rem;
}

/* File Upload Areas */
.folder-upload-container {
    border: 2px dashed var(--gray-200);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
    cursor: pointer;
}

.folder-upload-container:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}

.folder-upload-container input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.referral-upload {
    border: 2px dashed var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    cursor: pointer;
}

.referral-upload:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}

.referral-upload input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Upload Button */
.upload-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

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

/* History Panel */
.history-panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.history-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

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

.patient-name {
    font-weight: 600;
    color: var(--gray-700);
}

.site-name {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.upload-date {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.history-details {
    display: flex;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.detail-item svg {
    width: 1rem;
    height: 1rem;
}

.has-referral {
    color: var(--success);
}

.no-referral {
    color: var(--gray-400);
}

/* Progress Bar */
.upload-progress {
    margin-top: 1rem;
    display: none;
}

.upload-progress.active {
    display: block;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

/* Site Display */
.site-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
}

.site-display:hover {
    background: #e2e8f0;
}

#siteName {
    font-size: 16px;
    font-weight: 500;
    color: #334155;
}

.edit-icon {
    color: #64748b;
}

.site-name-input {
    font-size: 16px;
    padding: 4px 8px;
    border: 2px solid #2563eb;
    border-radius: 4px;
    width: 150px;
}

/* Site Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.modal {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.2),
        0 10px 10px -5px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal h2 {
    margin: 0 0 1rem 0;
    color: #1f2937;
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
}

.modal p {
    margin-bottom: 2rem;
    color: #6b7280;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.5;
}

.modal .form-group {
    margin-bottom: 2rem;
}

.modal input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.modal input:focus {
    outline: none;
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.modal button {
    width: 100%;
    padding: 1rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.modal button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.modal button:active {
    transform: translateY(0);
}

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

/* Add this if you want a nice hover effect on the button */
.modal button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    transition: transform 0.4s ease;
}

.modal button:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

/* Notification */
.notification-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
}

.notification {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.notification-icon {
    margin-bottom: 1rem;
}

.checkmark {
    width: 3rem;
    height: 3rem;
}

.checkmark-circle {
    stroke: var(--success);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    stroke: var(--success);
    stroke-width: 2;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

.notification h2 {
    color: var(--gray-700);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.notification p {
    color: var(--success);
    font-weight: 500;
}

/* Update these styles */
.folder-upload-container.has-files,
.referral-upload.has-files {
    border: 2px solid var(--success);
    background: var(--gray-50);
}

.file-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0.25rem;
}

.status-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--success);
    font-size: 0.875rem;
}

.status-check svg {
    width: 1rem;
    height: 1rem;
    stroke: var(--success);
}

.status-check span {
    color: var(--success);
    font-weight: 500;
}

.referral-upload.has-files .upload-hint {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Keep the upload containers consistent */
.folder-upload-container,
.referral-upload {
    border: 2px dashed var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Add these styles for better site name editing */
.site-name-input {
    background: white;
    border: 1px solid var(--primary);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 16px;
    color: var(--gray-700);
    font-family: 'Inter', sans-serif;
    width: auto;
    min-width: 120px;
}

.site-name-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(2,132,199,0.2);
}

#siteName {
    cursor: pointer;
    padding: 4px 8px;
}

#siteName:hover {
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
}

.error-status {
    border-left: 4px solid var(--error);
}

.success-status {
    border-left: 4px solid var(--success);
}

.error-details {
    margin-top: 8px;
}

.show-error-btn {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 8px;
}

.error-log {
    margin-top: 8px;
    padding: 8px;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 4px;
    color: var(--error);
    font-family: monospace;
    white-space: pre-wrap;
}