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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    margin: 0;
    font-size: 28px;
}

/* Barra de ferramentas */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 15px;
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
    align-items: center;
}

.toolbar button,
.toolbar select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.toolbar button:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
}

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

.toolbar select {
    cursor: pointer;
    min-width: 120px;
}

.toolbar select:hover {
    border-color: #667eea;
}

.separator {
    width: 1px;
    height: 24px;
    background: #ddd;
    margin: 0 5px;
}

/* Editor */
.editor {
    min-height: 400px;
    padding: 30px;
    outline: none;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

.editor:focus {
    background: #fafafa;
}

.editor p {
    margin-bottom: 10px;
}

.editor h1,
.editor h2,
.editor h3,
.editor h4 {
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.editor ul,
.editor ol {
    margin-left: 30px;
    margin-bottom: 10px;
}

/* Visualizador de HTML */
.html-viewer {
    background: #1e1e1e;
    padding: 20px;
    border-top: 2px solid #e0e0e0;
}

.html-viewer h3 {
    color: #61dafb;
    margin-bottom: 10px;
    font-size: 16px;
}

.html-viewer pre {
    background: #2d2d2d;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
}

/* Informações */
.info {
    padding: 20px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.info p {
    flex: 1;
    margin: 0;
    color: #666;
}

.info code {
    background: #e0e0e0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #d63384;
}

.info button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.info button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

/* Scrollbar personalizada */
.html-viewer pre::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.html-viewer pre::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.html-viewer pre::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.html-viewer pre::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Google Authentication Section */
.google-section {
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.auth-container {
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.auth-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: white;
    border: 2px solid #ffc107;
    border-radius: 6px;
    font-weight: 500;
    color: #856404;
}

.auth-status.authenticated {
    border-color: #28a745;
    color: #155724;
}

.user-photo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #28a745;
}

#signOutButton {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

#signOutButton:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Google Drive Controls */
.drive-controls {
    padding: 15px 30px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.drive-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.file-name-input {
    flex: 1;
    min-width: 200px;
}

.file-name-input input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.file-name-input input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
}

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

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
}

.close-modal {
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    transition: transform 0.2s;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.close-modal:hover {
    transform: rotate(90deg);
}

/* Files List */
.files-list {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.loading,
.no-files,
.error {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.error {
    color: #dc3545;
}

.files-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s;
}

.file-item:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateX(5px);
}

.file-icon {
    font-size: 32px;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.file-meta {
    font-size: 12px;
    color: #666;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.btn-load,
.btn-delete {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.btn-load {
    background: #28a745;
}

.btn-load:hover {
    background: #218838;
    transform: scale(1.1);
}

.btn-delete {
    background: #dc3545;
}

.btn-delete:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Responsividade */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 22px;
        padding: 15px 20px;
    }

    .toolbar {
        padding: 10px;
    }

    .editor {
        padding: 20px;
        min-height: 300px;
    }

    .info {
        flex-direction: column;
        align-items: stretch;
    }

    .info button {
        width: 100%;
    }

    .auth-container,
    .drive-controls {
        padding: 15px;
    }

    .drive-actions {
        flex-direction: column;
    }

    .file-name-input {
        width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .file-item {
        flex-wrap: wrap;
    }

    .file-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
