:root {
    --background-color: #f4f7f9;
    --card-background: #ffffff;
    --text-color: #333;
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --border-color: #e0e0e0;
    --shadow: 0 4px 8px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background-color: var(--card-background);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 10px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-weight: 600;
}

.header-actions button {
    background-color: var(--primary-color);
    color: white;
}

.header-actions button:hover {
    background-color: var(--primary-hover);
}


/* General Button Style */
button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

/* Action Box for Text Pasting */
.action-box {
    background: var(--card-background);
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
    box-shadow: var(--shadow);
}

#text-input {
    width: 100%;
    min-height: 80px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    box-sizing: border-box;
    resize: vertical;
}

.action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#save-text-btn {
    background-color: var(--primary-color);
    color: white;
}

#save-text-btn:hover {
    background-color: var(--primary-hover);
}

.content-section {
    margin-bottom: 40px;
}

.content-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.item-card {
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-delete-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #999;
}
.card-delete-btn:hover {
    color: #e74c3c;
}

.card-content {
    padding: 15px;
    flex-grow: 1;
}

.text-preview {
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 150px;
    overflow: hidden;
    position: relative;
}
.text-preview.truncated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, var(--card-background));
}

.file-info {
    font-size: 0.9em;
    color: #666;
}

.card-actions {
    padding: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border-color);
}

.card-actions button {
    background-color: #6c757d;
    color: white;
}
.card-actions button:hover {
    background-color: #5a6268;
}

/* Upload Progress Bar Card */
.progress-card {
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-card .file-info {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.2s ease-in-out;
    text-align: center;
    color: white;
    font-size: 0.8rem;
    line-height: 20px;
}

.progress-card.error .progress-bar {
    background-color: #e74c3c; /* Red for error */
    width: 100% !important;
}

.progress-card.error .progress-status {
    color: #e74c3c;
    font-weight: 500;
}

/* Drag and Drop Overlay */
.drop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 123, 255, 0.9);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.drop-message {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
}

body.drag-over .drop-overlay {
    display: flex;
}

/* Style for text snippet cards */
.item-card.type-text .card-header {
    background-color: #fffbef;
}

/* Style for file cards */
.item-card.type-file .card-header {
    background-color: #deeaf5;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
