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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.container {
    display: flex;
    height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: white;
    border-right: 2px solid #e0e0e0;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}

.logo {
    padding: 20px;
    background: #2196F3;
    color: white;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.mode-selector {
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.mode-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border: 2px solid #e0e0e0;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.mode-btn:hover {
    background: #f5f5f5;
    border-color: #2196F3;
}

.mode-btn.active {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

.tools-panel {
    padding: 20px;
}

.tool-section {
    margin-bottom: 20px;
}

.tool-section h3 {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tool-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 6px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    text-align: left;
}

.tool-btn:hover {
    background: #e3f2fd;
    border-color: #2196F3;
}

.tool-btn.active {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: white;
    padding: 15px 20px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.action-group {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 10px 16px;
    background: #2196F3;
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn:hover {
    background: #1976D2;
}

.btn.secondary {
    background: white;
    color: #2196F3;
    border: 2px solid #2196F3;
}

.btn.secondary:hover {
    background: #e3f2fd;
}

.btn.danger {
    background: #f44336;
}

.btn.danger:hover {
    background: #d32f2f;
}

.workspace {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.canvas-area {
    flex: 1;
    background: #f5f5f5;
    position: relative;
    overflow: auto;
    padding: 20px;
}

.upload-zone {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px dashed #ccc;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.upload-zone:hover {
    border-color: #2196F3;
    background: #e3f2fd;
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.upload-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.canvas-container {
    position: relative;
    display: inline-block;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
    max-height: calc(100vh - 200px);
}

#annotationCanvas {
    display: block;
    cursor: crosshair;
    max-width: 100%;
    max-height: 100%;
}

/* Text Editor */
.text-editor {
    width: 100%;
    height: 100%;
    padding: 30px;
    overflow-y: auto;
    background: white;
}

.text-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    line-height: 2;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 900px;
    margin: 0 auto;
}

.entity-person { 
    background: rgba(244, 67, 54, 0.2); 
    border-bottom: 2px solid #f44336; 
}

.entity-location { 
    background: rgba(33, 150, 243, 0.2); 
    border-bottom: 2px solid #2196F3; 
}

.entity-organization { 
    background: rgba(255, 193, 7, 0.2); 
    border-bottom: 2px solid #ffc107; 
}

.entity-date { 
    background: rgba(76, 175, 80, 0.2); 
    border-bottom: 2px solid #4caf50; 
}

/* Converter Area */
.converter-area {
    width: 100%;
    height: 100%;
    padding: 30px;
    overflow-y: auto;
}

.converter-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto 20px;
}

.converter-card h2 {
    color: #2196F3;
    margin-bottom: 20px;
}

.converter-card p {
    color: #666;
    margin-bottom: 20px;
}

.file-drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.file-drop-zone:hover {
    border-color: #2196F3;
    background: #e3f2fd;
}

.conversion-output {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    font-family: monospace;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

/* Properties Panel */
.properties-panel {
    width: 300px;
    background: white;
    border-left: 2px solid #e0e0e0;
    overflow-y: auto;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
}

.panel-section {
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.panel-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #2196F3;
}

.annotation-list {
    max-height: 300px;
    overflow-y: auto;
}

.annotation-item {
    padding: 10px;
    background: #f5f5f5;
    margin-bottom: 8px;
    border-radius: 6px;
    cursor: pointer;
    border-left: 4px solid #2196F3;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.annotation-item:hover {
    background: #e3f2fd;
}

.delete-btn {
    color: #f44336;
    cursor: pointer;
    font-weight: bold;
    padding: 4px 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-card {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #2196F3;
}

.stat-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

textarea, select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 10px;
    font-family: inherit;
}

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border-left: 4px solid #4caf50;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

@keyframes slideIn {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification.error {
    border-left-color: #f44336;
}

/* Tool Grid */
.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.tool-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.tool-card h4 {
    color: #2196F3;
    margin-bottom: 10px;
    font-size: 14px;
}

.tool-card button {
    width: 100%;
    padding: 12px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.tool-card button:hover {
    background: #1976D2;
}

/* Results Section */
.result-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.result-section h3 {
    color: #2196F3;
    margin-bottom: 15px;
    font-size: 16px;
}

.result-item {
    background: #f5f5f5;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 4px solid #FF9800;
    font-size: 13px;
    line-height: 1.5;
}

.result-item.success {
    border-left-color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.result-item.warning {
    border-left-color: #ff9800;
    background: rgba(255, 152, 0, 0.1);
}

.result-item.error {
    border-left-color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

/* File List */
.file-list {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.file-list-item {
    padding: 8px;
    background: white;
    margin-bottom: 6px;
    border-radius: 4px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-list-item .remove-file {
    cursor: pointer;
    color: #f44336;
    font-weight: bold;
}