.editor-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
    background-color: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
    box-shadow: var(--md-sys-elevation-level1);
    margin-top: 20px;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
}

.editor-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    background-color: var(--md-sys-color-surface);
}

.back-button {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 16px;
    color: var(--md-sys-color-on-surface);
    transition: background-color 0.2s ease;
}

.back-button:hover {
    background-color: var(--md-sys-color-surface-variant);
}

.editor-title {
    flex: 1;
    font-size: 20px;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface);
    padding: 8px 0;
    outline: none;
    font-family: 'Inter Tight', sans-serif;
}

.editor-title:focus {
    border-bottom: 2px solid var(--md-sys-color-primary);
}

.save-button {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: 100px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.save-button:hover {
    background-color: #0052A3;
    box-shadow: var(--md-sys-elevation-level1);
}

.editor-toolbar {
    display: flex;
    gap: 8px;
    padding: 4px 12px;
    background: var(--md-sys-color-surface-variant);
    border-radius: 100px;
}

.toolbar-button {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-surface);
    transition: background-color 0.2s ease;
}

.toolbar-button:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.options-button {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    color: var(--md-sys-color-on-surface);
    transition: background-color 0.2s ease;
}

.options-button:hover {
    background-color: var(--md-sys-color-surface-variant);
}

.editor-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    outline: none;
    font-family: 'Inter Tight', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--md-sys-color-on-surface);
}

.editor-content[placeholder]:empty:before {
    content: attr(placeholder);
    color: var(--md-sys-color-outline);
    font-style: italic;
}

.editor-content ul,
.editor-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

.editor-content ul {
    list-style-type: disc;
}

.editor-content ol {
    list-style-type: decimal;
}

.editor-content b,
.editor-content strong {
    font-weight: 600;
}

.editor-content i,
.editor-content em {
    font-style: italic;
}

.editor-content u {
    text-decoration: underline;
}

.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.dialog {
    background-color: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-large);
    box-shadow: var(--md-sys-elevation-level3);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
}

.dialog-header {
    padding: 20px 24px;
    font-size: 20px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.dialog-content {
    padding: 20px 24px;
}

.dialog-content label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
}

.dialog-content input,
.dialog-content select {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-small);
    font-family: 'Inter Tight', sans-serif;
    font-size: 16px;
    color: var(--md-sys-color-on-surface);
    background-color: var(--md-sys-color-surface);
    outline: none;
    transition: border-color 0.2s ease;
}

.dialog-content input:focus,
.dialog-content select:focus {
    border-color: var(--md-sys-color-primary);
}

.dialog-content input.error {
    border-color: var(--md-sys-color-error);
    animation: shake 0.3s ease-in-out;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    gap: 12px;
}

.cancel-button {
    background-color: transparent;
    color: var(--md-sys-color-primary);
    border: none;
    border-radius: 100px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.cancel-button:hover {
    background-color: rgba(0, 97, 164, 0.08);
}

.create-button {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: 100px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.create-button:hover {
    background-color: #0052A3;
    box-shadow: var(--md-sys-elevation-level1);
}

.context-menu {
    position: fixed;
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-medium);
    box-shadow: var(--md-sys-elevation-level2);
    min-width: 180px;
    overflow: hidden;
    z-index: 1000;
    animation: menuFadeIn 0.2s ease-out;
}

.menu-item {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: var(--md-sys-color-on-surface);
    transition: background-color 0.2s ease;
}

.menu-item:hover {
    background-color: var(--md-sys-color-surface-variant);
}

.menu-item .material-symbols-rounded {
    font-size: 20px;
}

.rename-dialog {
    max-width: 400px;
}

.rename-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-small);
    font-family: 'Inter Tight', sans-serif;
    font-size: 16px;
    margin-top: 8px;
}

.rename-input:focus {
    border-color: var(--md-sys-color-primary);
    outline: none;
}

.document-card {
    min-width: 0;
    width: 100%;
    height: 80px;
    animation: fadeIn 0.3s ease-out;
}

.documents-grid .card {
    min-width: 0;
    width: 100%;
}

.avatar.blue {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.avatar.green {
    background-color: #D9E7CB;
    color: #1F3700;
}

.avatar.orange {
    background-color: #FFE0B2;
    color: #3E2E00;
}

.avatar.purple {
    background-color: var(--md-sys-color-tertiary-container);
    color: var(--md-sys-color-on-tertiary-container);
}

.avatar.red {
    background-color: #FFCDD2;
    color: #410001;
}

.snackbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #323232;
    color: white;
    padding: 14px 20px;
    border-radius: 4px;
    box-shadow: var(--md-sys-elevation-level2);
    font-size: 14px;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.snackbar.show {
    transform: translateX(-50%) translateY(0);
}

.snackbar.error {
    background-color: var(--md-sys-color-error);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

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

@media (max-width: 768px) {
    .editor-container {
        height: calc(100vh - 80px);
        margin-top: 10px;
    }
    
    .dialog {
        max-width: 90%;
    }
}

.mini-cards-column {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    height: 100%;
}

.mini-cards-column .mini-card {
    min-height: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mini-cards-column .mini-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--md-sys-elevation-level2);
}

.large-card {
    grid-column: span 1;
    grid-row: span 2;
    display: flex;
    flex-direction: row;
    height: 380px;
    padding: 0;
    gap: 8px;
}

.large-card .content-section {
    flex: 1;
    padding: 8px;
}

.large-card .image-section {
    width: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 8px 8px 0;
}

.large-card .image-section img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}