@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #2d3748;
    --accent-color: #6366f1;  
    --accent-hover: #4f46e5;  
    --border-color: #e9ecef;
    --soft-shadow: 0 10px 25px rgba(0,0,0,0.05);  
    --transition-speed: 0.3s;
    --gradient-bg: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);  
}

.dark-theme {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --text-primary: #e2e8f0;
    --border-color: #4a5568;
    --soft-shadow: 0 10px 25px rgba(0,0,0,0.2);
    --gradient-bg: linear-gradient(135deg, #1a202c 0%, #2c3344 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--gradient-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px 0 !important;
}

body.has-fullscreen {
    overflow: hidden;
}

.main-content {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 1600px;
    gap: 20px;
}

.ad-container {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    box-shadow: var(--soft-shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.top-ad {
    width: 90%;
    max-width: 1100px;
    height: 90px;
    margin-bottom: 40px;
}

.bottom-ad {
    width: 90%;
    max-width: 1100px;
    height: 120px;
    margin-top: 40px;
}

.left-sidebar, .right-sidebar {
    width: 160px;
    height: 600px;
    align-self: flex-start;
}

.ad-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: rgba(106, 90, 223, 0.05);
    color: #999;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dark-theme .ad-placeholder {
    background-color: rgba(106, 90, 223, 0.15);
    color: #bbb;
}

.notepad-container {
    width: 90%;  
    max-width: 1100px;  
    background-color: var(--bg-secondary);
    border-radius: 24px;  
    box-shadow: var(--soft-shadow);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.03);
    margin-top: 20px;
    transform: translateY(-20px);
    transition: all var(--transition-speed) ease;
    min-height: 80vh;  
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.dark-theme .notepad-container {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.notepad-container.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    border-radius: 0;
    transform: none;
    z-index: 10000; 
    display: flex;
    flex-direction: column;
    max-width: 100%; 
    overflow: hidden; 
    background-color: var(--bg-secondary);
    bottom: 0;  
}

.notepad-container.fullscreen-mode .toolbar {
    border-radius: 0;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 10001; 
    margin-top: 10px;
}

.notepad-container.fullscreen-mode .editor-container {
    flex: 1;
    overflow: hidden; 
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px); 
}

.notepad-container.fullscreen-mode #notepad {
    min-height: 0;
    max-height: none !important; 
    height: 100%; 
    padding: 30px;
    flex: 1;
    overflow-y: auto !important;
    box-sizing: border-box; 
}

.notepad-container:fullscreen {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    transform: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    min-height: 100vh;
}

.notepad-container:hover {
    box-shadow: 0 20px 50px rgba(0,0,0,0.12);  
    transform: translateY(-25px);  
}

.toolbar {
    display: flex;
    background-color: var(--bg-primary);
    padding: 10px 15px;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 20px 20px 0 0;
    overflow-x: auto;
    justify-content: center;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    background-color: rgba(255, 255, 255, 0.4);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.03);
}

.dark-theme .toolbar-group {
    background-color: rgba(0, 0, 0, 0.1);
}

.toolbar-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 8px;
    transition: all 0.2s ease;
    opacity: 0.8;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    background-color: var(--bg-secondary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.toolbar-btn i {
    font-size: 18px;
}

.toolbar-btn:hover {
    background-color: rgba(99, 102, 241, 0.1);
    opacity: 1;
    color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.toolbar-btn.active {
    background-color: rgba(99, 102, 241, 0.18);
    color: var(--accent-color);
    opacity: 1;
    border-color: var(--accent-color);
    font-weight: 500;
}

.dark-theme .toolbar-btn {
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.dark-theme .toolbar-btn:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.color-input {
    height: 34px;
    width: 34px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    background-color: transparent;
    cursor: pointer;
}

.color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input::-webkit-color-swatch {
    border: none;
}

.font-selector, .font-size-selector {
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    min-width: 180px;
    outline: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236a5adf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 35px;
}

.font-size-selector {
    min-width: 100px;
}

.font-selector:hover, .font-selector:focus, .font-size-selector:hover, .font-size-selector:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(106, 90, 223, 0.2);
}

.font-selector option, .font-size-selector option {
    padding: 10px;
}

.dark-theme .font-selector, 
.dark-theme .font-size-selector {
    background-color: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
}

#notepad {
    width: 100%;
    min-height: 600px;  
    max-height: 75vh;
    border: none;
    font-size: 19px;  
    line-height: 1.9;  
    background-color: transparent;
    outline: none;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    padding: 25px 30px;
    overflow-y: auto;
    white-space: pre-wrap;
}

#notepad:empty:before {
    content: attr(placeholder);
    color: #888;
    pointer-events: none;
}

#notepad:focus {
    outline: 3px solid rgba(106, 90, 223, 0.2);
    outline-offset: 8px;
    border-radius: 8px;
}

#notepad::-webkit-scrollbar {
    width: 8px;
}

#notepad::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

#notepad::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 4px;
}

#notepad table {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0;
}

#notepad th, #notepad td {
    border: 1px solid #ddd;
    padding: 8px;
}

#notepad th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.dark-theme #notepad th {
    background-color: #2d3748;
    border-color: #4a5568;
}

.dark-theme #notepad td {
    border-color: #4a5568;
}

.save-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.2s ease-out;
}

.save-modal-content {
    background-color: var(--bg-secondary);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 450px;
    text-align: center;
    transform: translateY(0);
    animation: slideUp 0.3s ease-out;
}

.save-modal-content h3 {
    margin-bottom: 18px;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
}

.save-modal-content p {
    margin-bottom: 30px;
    color: #666;
    font-size: 16px;
}

.save-modal-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.save-modal-buttons button {
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 15px;
    position: relative;
    overflow: hidden;
}

.save-modal-buttons button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.save-modal-buttons button:hover::before {
    width: 300px;
    height: 300px;
}

#modal-save {
    background-color: var(--accent-color);
    color: white;
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    box-shadow: 0 4px 12px rgba(106, 90, 223, 0.3);
}

#modal-save:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(106, 90, 223, 0.4);
}

#modal-discard {
    background-color: #f44336;
    color: white;
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

#modal-discard:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(244, 67, 54, 0.4);
}

#modal-export {
    background-color: #4caf50;
    color: white;
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

#modal-export:hover {
    background-color: #388e3c;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

#modal-cancel {
    background-color: #f5f5f5;
    color: #333;
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#modal-cancel:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.code-modal, .table-modal {
    max-width: 600px;
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    font-family: monospace;
    resize: vertical;
    min-height: 150px;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.dark-theme pre, .dark-theme code {
    background-color: #2d3748 !important;
    border-color: #4a5568 !important;
    color: #e2e8f0 !important;
}

.color-picker {
    width: 45px;
    height: 45px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    padding: 0;
    -webkit-appearance: none;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
    box-shadow: 0 0 0 1px var(--border-color);
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 2500;
    min-width: 300px;
    border: 1px solid var(--border-color);
    animation: toastIn 0.5s ease-out;
    transition: all 0.5s ease;
}

.toast-success {
    border-left: 5px solid #4caf50;
}

.toast-error {
    border-left: 5px solid #f44336;
}

.toast-warning {
    border-left: 5px solid #ff9800;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
}

.toast-content i {
    font-size: 24px;
    color: var(--accent-color);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background-color: var(--accent-color);
    width: 100%;
    animation: toastProgress 3s linear;
}

.toast-exit {
    opacity: 0;
    transform: translateX(100%);
}

@keyframes toastIn {
    from { 
        opacity: 0;
        transform: translateX(100%);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

.saved-files-container {
    width: 90%;
    max-width: 1100px;
    background-color: var(--bg-secondary);
    border-radius: 15px;
    box-shadow: var(--soft-shadow);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    transition: height 0.3s ease;
}

.dark-theme .saved-files-container {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.saved-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.saved-files-header:hover {
    background-color: rgba(106, 90, 223, 0.1);
}

.saved-files-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.toggle-saved-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background-color: var(--bg-primary);
}

.toggle-saved-btn:hover {
    background-color: rgba(106, 90, 223, 0.12);
    color: var(--accent-color);
}

.toggle-saved-btn i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.toggle-saved-btn.collapsed i {
    transform: rotate(180deg);
}

.saved-files-list {
    display: none;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 15px;
    gap: 15px;
    scroll-behavior: smooth;
    min-height: 100px;
}

.saved-files-list::-webkit-scrollbar {
    height: 8px;
}

.saved-files-list::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

.saved-files-list::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 4px;
}

.saved-file-card {
    min-width: 200px;
    max-width: 200px;
    height: 160px;
    background-color: var(--bg-primary);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.saved-file-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--accent-color);
}

.saved-file-card.active {
    border: 2px solid var(--accent-color);
    background-color: rgba(106, 90, 223, 0.05);
}

.saved-file-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-file-preview {
    flex-grow: 1;
    font-size: 13px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.saved-file-date {
    font-size: 12px;
    color: #888;
    margin-top: 10px;
}

.saved-file-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.saved-file-card:hover .saved-file-actions {
    opacity: 1;
}

.file-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-action-btn:hover {
    background-color: var(--accent-color);
    color: white;
}

.rename-modal {
    max-width: 400px;
}

.rename-input {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-size: 16px;
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
}

.rename-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(106, 90, 223, 0.2);
}

.rename-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

#modal-rename {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(106, 90, 223, 0.3);
}

#modal-rename:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(106, 90, 223, 0.4);
}

#modal-cancel-rename {
    background-color: #f5f5f5;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#modal-cancel-rename:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.format-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.format-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--bg-primary);
    width: 110px;
    text-align: center;
}

.format-option i {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--accent-color);
}

.format-option span {
    font-size: 14px;
}

.format-option:hover {
    border-color: var(--accent-color);
    background-color: rgba(106, 90, 223, 0.05);
    transform: translateY(-3px);
}

.download-format-modal h3 {
    margin-bottom: 20px;
}

.format-options.horizontal {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

.link-modal, .image-modal {
    max-width: 500px;
}

.link-form, .image-form {
    margin-bottom: 20px;
    text-align: left;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

#notepad a {
    color: var(--accent-color);
    text-decoration: underline;
    transition: all 0.2s;
}

#notepad a:hover {
    opacity: 0.8;
}

#insert-link-btn, #insert-image-btn {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(106, 90, 223, 0.3);
}

#insert-link-btn:hover, #insert-image-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(106, 90, 223, 0.4);
}

#cancel-link-btn, #cancel-image-btn {
    background-color: #f5f5f5;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#cancel-link-btn:hover, #cancel-image-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.tool-description {
    width: 90%;
    max-width: 1100px;
    margin: 40px auto;
    padding: 30px;
    background-color: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: var(--soft-shadow);
    text-align: center;
}

.dark-theme .tool-description {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.tool-description h2 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 2rem;
}

.tool-description > p {
    max-width: 800px;
    margin: 0 auto 30px;
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
}

.dark-theme .tool-description > p {
    color: #a0aec0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.feature {
    background-color: var(--bg-primary);
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.dark-theme .feature {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border-color: var(--accent-color);
}

.feature i {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    background-color: rgba(99, 102, 241, 0.1);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.feature h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.feature p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

.dark-theme .feature p {
    color: #cbd5e0;
}

.guide-section {
    width: 90%;
    max-width: 1100px;
    margin: 60px auto 80px;
}

.guide-container {
    background-color: var(--bg-secondary);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    padding: 50px;
    border: 1px solid var(--border-color);
    max-width: 1100px;
    margin: 0 auto;
}

.dark-theme .guide-container {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.guide-title {
    color: var(--accent-color);
    margin-bottom: 40px;
    font-size: 32px;
    text-align: center;
    position: relative;
    padding-bottom: 20px;
    font-weight: 700;
}

.guide-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 4px;
}

.guide-content {
    text-align: left;
    color: var(--text-primary);
    line-height: 1.8;
}

.guide-content h3 {
    font-size: 24px;
    margin: 40px 0 24px;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.guide-content h3:first-child {
    margin-top: 0;
}

.guide-content p {
    margin-bottom: 20px;
    line-height: 1.9;
    font-size: 17px;
    color: #4a5568;
}

.dark-theme .guide-content p {
    color: #cbd5e0;
}

.faq-section {
    margin-top: 50px;
    border-top: 2px solid var(--border-color);
    padding-top: 30px;
}

.faq-section h3 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 30px;
    color: var(--accent-color);
}

.faq-item {
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h4 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.faq-item p {
    color: #555;
    line-height: 1.6;
}

.dark-theme .faq-item p {
    color: #cbd5e0;
}

.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.conversion-note {
    margin: 15px 0;
    font-size: 14px;
    color: #666;
    text-align: center;
    line-height: 1.5;
    padding: 10px;
    border-radius: 8px;
    background-color: rgba(106, 90, 223, 0.05);
}

.dark-theme .conversion-note {
    color: #a0aec0;
    background-color: rgba(106, 90, 223, 0.1);
}

#convert-docx-btn {
    background-color: #4a5568;
    color: white;
    box-shadow: 0 4px 12px rgba(74, 85, 104, 0.3);
}

#convert-docx-btn:hover {
    background-color: #2d3748;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 85, 104, 0.4);
}

.export-docx-btn {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(106, 90, 223, 0.3);
}

.export-docx-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(106, 90, 223, 0.4);
}

/* Context Menu Styles */
.context-menu {
    position: absolute;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 5px 0;
    z-index: 10002;
}

.context-menu-item {
    padding: 8px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: var(--text-primary);
    white-space: nowrap;
}

.context-menu-item:hover {
    background-color: var(--accent-color);
    color: white;
}

.dark-theme .faq-item p {
    color: #cbd5e0;
}

.more-formats-container {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.show-more-formats {
    background-color: var(--bg-primary);
    border: 1px dashed var(--border-color);
}

.show-more-formats:hover {
    background-color: rgba(106, 90, 223, 0.05);
    border-color: var(--accent-color);
}

.find-replace-modal {
    max-width: 500px;
}

.find-replace-modal .form-group {
    margin-bottom: 15px;
    text-align: left;
}

.find-replace-modal .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.find-replace-modal .form-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 14px;
}

.find-replace-modal .form-group input[type="checkbox"] {
    margin-right: 8px;
}

.find-replace-modal .save-modal-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

#find-next-btn, #replace-btn, #replace-all-btn, #cancel-find-btn {
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

#find-next-btn {
    background-color: var(--accent-color);
    color: white;
    grid-column: 1 / 2;
    grid-row: 1 / 2;
}

#replace-btn {
    background-color: #4caf50;
    color: white;
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

#replace-all-btn {
    background-color: #ff9800;
    color: white;
    grid-column: 1 / 2;
    grid-row: 2 / 3;
}

#cancel-find-btn {
    background-color: #f5f5f5;
    color: #333;
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

#find-next-btn:hover, #replace-btn:hover, #replace-all-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

#cancel-find-btn:hover {
    background-color: #e0e0e0;
}

.word-counter-container {
    display: flex;
    align-items: center;
    margin-left: 10px;
    padding: 6px 10px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-primary);
}

.dark-theme .word-counter-container {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-container {
    background-color: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    padding: 30px;
    width: 90%;
    max-width: 450px;
    animation: slideUp 0.3s ease-out;
}

.modal-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.modal-message {
    margin-bottom: 25px;
    color: #666;
    line-height: 1.5;
}

.dark-theme .modal-message {
    color: #a0aec0;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 15px;
}

.modal-btn-primary {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(106, 90, 223, 0.3);
}

.modal-btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(106, 90, 223, 0.4);
}

.modal-btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-btn-secondary:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.modal-input {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-size: 16px;
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
}

.modal-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(106, 90, 223, 0.2);
}

.footer {
    width: 100%;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    text-align: center;
    box-shadow: var(--soft-shadow);
    margin-top: 40px;
}

.dark-theme .footer {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-menu li a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 15px;
    position: relative;
    padding: 5px 0;
}

.footer-menu li a:hover {
    color: var(--accent-color);
}

.footer-menu li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.footer-menu li a:hover::after {
    width: 100%;
}

.footer-menu li:not(:last-child)::after {
    content: '|';
    color: var(--border-color);
    margin-left: 20px;
}

.form-group {
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .toolbar {
        padding: 8px;
        gap: 5px;
        flex-wrap: wrap;
        overflow-x: visible;
        justify-content: center;
        -webkit-overflow-scrolling: touch;
    }
    
    .toolbar-group {
        flex-shrink: 0;
        padding: 3px;
        gap: 3px;
        margin-bottom: 5px;
    }
    
    .toolbar-btn {
        min-width: 28px;
        min-height: 28px;
        padding: 4px;
        margin: 2px;
    }
    
    .toolbar-btn i {
        font-size: 15px;
    }
    
    .separator {
        height: 20px;
        margin: 3px;
    }
}

@media (max-width: 480px) {
    .toolbar-group {
        width: auto;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .word-counter-container {
        width: 100%;
        justify-content: center;
        margin: 5px 0;
    }
}

@media (max-width: 768px) {
    .guide-container {
        padding: 30px 20px;
    }
    
    .guide-title {
        font-size: 26px;
    }
    
    .guide-content h3 {
        font-size: 22px;
    }
    
    .guide-content p {
        font-size: 16px;
    }
    
    .faq-item h4 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .toolbar {
        border-radius: 12px 12px 0 0;
    }
    
    .toolbar-group {
        margin-bottom: 5px;
    }
    
    .word-counter-container {
        display: none;
    }
}

blockquote {
    margin: 15px 0;
    position: relative;
}

blockquote:after {
    content: '';
    display: block;
    height: 40px;
}
